aboutsummaryrefslogtreecommitdiff
path: root/testes/code.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-12-28 18:38:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-12-28 18:38:20 -0300
commitb5ab31a475ccf5f96c2ffb34fccc1d6592913794 (patch)
treeef6d2b1844ca672dc81ab4411e37abbef2b7c48f /testes/code.lua
parent140cdcced5e28bde7a89e88fcae428f318565f1d (diff)
parent314745ed8438d1276c6c928d5f9d4be018dfadb6 (diff)
downloadlua-b5ab31a475ccf5f96c2ffb34fccc1d6592913794.tar.gz
lua-b5ab31a475ccf5f96c2ffb34fccc1d6592913794.tar.bz2
lua-b5ab31a475ccf5f96c2ffb34fccc1d6592913794.zip
Merge branch 'master' into nextversion
Diffstat (limited to 'testes/code.lua')
-rw-r--r--testes/code.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/code.lua b/testes/code.lua
index 543743fc..bd4b10d0 100644
--- a/testes/code.lua
+++ b/testes/code.lua
@@ -86,7 +86,7 @@ checkKlist(foo, {1, 1.0, 2, 2.0, 0, 0.0})
86-- testing opcodes 86-- testing opcodes
87 87
88-- check that 'f' opcodes match '...' 88-- check that 'f' opcodes match '...'
89function check (f, ...) 89local function check (f, ...)
90 local arg = {...} 90 local arg = {...}
91 local c = T.listcode(f) 91 local c = T.listcode(f)
92 for i=1, #arg do 92 for i=1, #arg do
@@ -99,7 +99,7 @@ end
99 99
100 100
101-- check that 'f' opcodes match '...' and that 'f(p) == r'. 101-- check that 'f' opcodes match '...' and that 'f(p) == r'.
102function checkR (f, p, r, ...) 102local function checkR (f, p, r, ...)
103 local r1 = f(p) 103 local r1 = f(p)
104 assert(r == r1 and math.type(r) == math.type(r1)) 104 assert(r == r1 and math.type(r) == math.type(r1))
105 check(f, ...) 105 check(f, ...)
@@ -107,7 +107,7 @@ end
107 107
108 108
109-- check that 'a' and 'b' has the same opcodes 109-- check that 'a' and 'b' has the same opcodes
110function checkequal (a, b) 110local function checkequal (a, b)
111 a = T.listcode(a) 111 a = T.listcode(a)
112 b = T.listcode(b) 112 b = T.listcode(b)
113 assert(#a == #b) 113 assert(#a == #b)