diff options
Diffstat (limited to 'Examples/test-suite/javascript/extend_template_method_runme.js')
-rw-r--r-- | Examples/test-suite/javascript/extend_template_method_runme.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/extend_template_method_runme.js b/Examples/test-suite/javascript/extend_template_method_runme.js new file mode 100644 index 000000000..42402045d --- /dev/null +++ b/Examples/test-suite/javascript/extend_template_method_runme.js @@ -0,0 +1,54 @@ +var extend_template_method = require("extend_template_method"); + +em = new extend_template_method.ExtendMe(); + +ret_double = em.do_stuff_double(1, 1.1); +if (ret_double != 1.1) { + throw new Error("double failed " + ret_double); +} +ret_string = em.do_stuff_string(1, "hello there"); +if (ret_string != "hello there") { + throw new Error("string failed " + ret_string); +} + +ret_double = em.do_overloaded_stuff(1.1); +if (ret_double != 1.1) { + throw new Error("double failed " + ret_double); +} +ret_string = em.do_overloaded_stuff("hello there"); +if (ret_string != "hello there") { + throw new Error("string failed " + ret_string); +} + +if (extend_template_method.ExtendMe.static_method(123) != 123) { + throw new Error("static_method failed"); +} + +em2 = new extend_template_method.ExtendMe(123); + +em = new extend_template_method.TemplateExtend(); + +ret_double = em.do_template_stuff_double(1, 1.1); +if (ret_double != 1.1) { + throw new Error("double failed " + ret_double); +} +ret_string = em.do_template_stuff_string(1, "hello there"); +if (ret_string != "hello there") { + throw new Error("string failed " + ret_string); +} + + +ret_double = em.do_template_overloaded_stuff(1.1); +if (ret_double != 1.1) { + throw new Error("double failed " + ret_double); +} +ret_string = em.do_template_overloaded_stuff("hello there"); +if (ret_string != "hello there") { + throw new Error("string failed " + ret_string); +} + +if (extend_template_method.TemplateExtend.static_template_method(123) != 123) { + throw new Error("static_template_method failed"); +} + +em2 = new extend_template_method.TemplateExtend(123); |