Add two Javascript testcases converted from Python
This commit is contained in:
parent
04b46cc8a3
commit
9739be60d0
2 changed files with 27 additions and 0 deletions
19
Examples/test-suite/javascript/inherit_missing_runme.js
Normal file
19
Examples/test-suite/javascript/inherit_missing_runme.js
Normal file
|
|
@ -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)
|
||||
|
|
@ -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")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue