diff options
Diffstat (limited to 'Examples/test-suite/javascript/inctest_runme.js')
-rw-r--r-- | Examples/test-suite/javascript/inctest_runme.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/inctest_runme.js b/Examples/test-suite/javascript/inctest_runme.js new file mode 100644 index 000000000..e0a42eab4 --- /dev/null +++ b/Examples/test-suite/javascript/inctest_runme.js @@ -0,0 +1,22 @@ +var inctest = require("inctest"); + +try { + a = new inctest.A(); +} catch (e) { + throw new Error("didn't find A, therefore, I didn't include 'testdir/subdir1/hello.i'"); +} + +try { + b = new inctest.B(); +} catch (e) { + throw new Error("didn't find B, therefore, I didn't include 'testdir/subdir2/hello.i'"); +} + +// Check the var in subdirectory worked = require("in subdirectory worked") +if (inctest.importtest1(5) != 15) { + throw new Error("var test 1 failed"); +} + +if (inctest.importtest2("black") != "white") { + throw new Error("var test 2 failed"); +} |