aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
Diffstat (limited to 'testes')
-rw-r--r--testes/api.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/testes/api.lua b/testes/api.lua
index dc485240..ae2f82dd 100644
--- a/testes/api.lua
+++ b/testes/api.lua
@@ -165,6 +165,23 @@ do -- test returning more results than fit in the caller stack
165end 165end
166 166
167 167
168do -- testing multipe returns
169 local function foo (n)
170 if n > 0 then return n, foo(n - 1) end
171 end
172
173 local t = {T.testC("call 1 10; return 10", foo, 20)}
174 assert(t[1] == 20 and t[10] == 11 and t[11] == nil)
175
176 local t = table.pack(T.testC("call 1 10; return 10", foo, 2))
177 assert(t[1] == 2 and t[2] == 1 and t[3] == nil and t.n == 10)
178
179 local t = {T.testC([[
180 checkstack 300 "error"; call 1 250; return 250]], foo, 250)}
181 assert(t[1] == 250 and t[250] == 1 and t[251] == nil)
182end
183
184
168-- testing globals 185-- testing globals
169_G.AA = 14; _G.BB = "a31" 186_G.AA = 14; _G.BB = "a31"
170local a = {T.testC[[ 187local a = {T.testC[[