issue #198 More tests
parent
a82d42b847
commit
8cec4cc827
@ -0,0 +1,6 @@
|
||||
x = {}
|
||||
f = compiler.load("x.a = 'Dibyendu' x[1] = 2")
|
||||
assert(f and type(f) == 'function')
|
||||
f()
|
||||
assert(x.a == 'Dibyendu')
|
||||
assert(x[1] == 2)
|
@ -0,0 +1,7 @@
|
||||
adder = compiler.load('local a: number, b: number = 1.1, 2.2 return a+b')
|
||||
assert(adder and type(adder) == 'function')
|
||||
assert(math.abs(adder() - 3.3) < 1e-15)
|
||||
|
||||
mult = compiler.load('local a: number, b: number = 1.1, 2.2 return a*b')
|
||||
assert(mult and type(mult) == 'function')
|
||||
assert(math.abs(mult() - 2.42) < 1e-15)
|
Loading…
Reference in new issue