Skip to content

Commit

Permalink
issue #198 Test cases for op_mov, op_br, op_cbr
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Sep 6, 2020
1 parent 4f7cab6 commit 4819f38
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/comptests/01_mov.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
f = compiler.load("local a, b, c = 4.2, true, 'hi' return a, b, c")
assert(f and type(f) == 'function')
local z = 62
local a,b,c,d = f()
assert(z == 62)
Expand Down
3 changes: 3 additions & 0 deletions tests/comptests/02_cbr_br.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f = compiler.load("local a,b = 1,2 return a or b");
assert(f and type(f) == 'function')
assert(f() == 1)
3 changes: 3 additions & 0 deletions tests/comptests/03_cbr_br.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f = compiler.load("local a,b = 1,2 return a and b");
assert(f and type(f) == 'function')
assert(f() == 2)
3 changes: 3 additions & 0 deletions tests/comptests/04_cbr_br.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f = compiler.load("local a = 2 return 1 or a");
assert(f and type(f) == 'function')
assert(f() == 1)
3 changes: 3 additions & 0 deletions tests/comptests/05_cbr_br.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f = compiler.load("local a = 2 return 1 and a");
assert(f and type(f) == 'function')
assert(f() == 2)

0 comments on commit 4819f38

Please sign in to comment.