issue #198 add tests for op_loadglobal, op_storeglobal
parent
523f07ba57
commit
174cfa0168
@ -0,0 +1,4 @@
|
||||
f = compiler.load('x=1')
|
||||
assert(f and type(f) == 'function')
|
||||
f()
|
||||
assert(x==1)
|
@ -0,0 +1,7 @@
|
||||
x = 1
|
||||
y = 2
|
||||
f = compiler.load('return x,y')
|
||||
assert(f and type(f) == 'function')
|
||||
local a,b = f()
|
||||
assert(a == 1)
|
||||
assert(b == 2)
|
@ -0,0 +1,7 @@
|
||||
x = 4
|
||||
y = 2
|
||||
f = compiler.load('x,y = y,x')
|
||||
assert(f and type(f) == 'function')
|
||||
f()
|
||||
assert(x == 2)
|
||||
assert(y == 4)
|
@ -0,0 +1,2 @@
|
||||
The tests in this folder are meant to be for the upcoming new compiler for Ravi.
|
||||
For details go to [https://github.com/dibyendumajumdar/ravi-compiler](https://github.com/dibyendumajumdar/ravi-compiler).
|
Loading…
Reference in new issue