diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2021-03-11 08:16:44 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2021-03-11 20:10:18 +0000 |
commit | 9739be60d0ad349fca158a98cb881b9f2469e94c (patch) | |
tree | 39fd373bbe8d1fbac7ead430d484895d6e28ef8d /Examples | |
parent | 04b46cc8a364ad99e47c138b076a9c6ed81e6584 (diff) | |
download | swig-9739be60d0ad349fca158a98cb881b9f2469e94c.tar.gz |
Add two Javascript testcases converted from Python
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/test-suite/javascript/inherit_missing_runme.js | 19 | ||||
-rw-r--r-- | Examples/test-suite/javascript/virtual_derivation_runme.js | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/inherit_missing_runme.js b/Examples/test-suite/javascript/inherit_missing_runme.js new file mode 100644 index 000000000..05f5760e2 --- /dev/null +++ b/Examples/test-suite/javascript/inherit_missing_runme.js @@ -0,0 +1,19 @@ +var inherit_missing = require("inherit_missing"); + +a = inherit_missing.new_Foo() +b = new inherit_missing.Bar() +c = new inherit_missing.Spam() + +x = inherit_missing.do_blah(a) +if (x != "Foo::blah") + throw new Error("Whoa! Bad return {}".format(x)) + +x = inherit_missing.do_blah(b) +if (x != "Bar::blah") + throw new Error("Whoa! Bad return {}".format(x)) + +x = inherit_missing.do_blah(c) +if (x != "Spam::blah") + throw new Error("Whoa! Bad return {}".format(x)) + +inherit_missing.delete_Foo(a) diff --git a/Examples/test-suite/javascript/virtual_derivation_runme.js b/Examples/test-suite/javascript/virtual_derivation_runme.js new file mode 100644 index 000000000..be87a5d9a --- /dev/null +++ b/Examples/test-suite/javascript/virtual_derivation_runme.js @@ -0,0 +1,8 @@ +var virtual_derivation = require("virtual_derivation"); +// +// very innocent example +// +b = new virtual_derivation.B(3) +if (b.get_a() != b.get_b()) + throw new Error("something is really wrong") + |