aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
Diffstat (limited to 'testes')
-rw-r--r--testes/errors.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/testes/errors.lua b/testes/errors.lua
index 63a7b740..19a7b6fa 100644
--- a/testes/errors.lua
+++ b/testes/errors.lua
@@ -1,4 +1,4 @@
1-- $Id: errors.lua,v 1.97 2017/11/28 15:31:56 roberto Exp $ 1-- $Id: errors.lua $
2-- See Copyright Notice in file all.lua 2-- See Copyright Notice in file all.lua
3 3
4print("testing errors") 4print("testing errors")
@@ -299,7 +299,7 @@ end
299local function lineerror (s, l) 299local function lineerror (s, l)
300 local err,msg = pcall(load(s)) 300 local err,msg = pcall(load(s))
301 local line = string.match(msg, ":(%d+):") 301 local line = string.match(msg, ":(%d+):")
302 assert((line and line+0) == l) 302 assert(tonumber(line) == l)
303end 303end
304 304
305lineerror("local a\n for i=1,'a' do \n print(i) \n end", 2) 305lineerror("local a\n for i=1,'a' do \n print(i) \n end", 2)
@@ -350,6 +350,23 @@ X=1;lineerror((p), 2)
350X=2;lineerror((p), 1) 350X=2;lineerror((p), 1)
351 351
352 352
353lineerror([[
354local b = false
355if not b then
356 error 'test'
357end]], 3)
358
359lineerror([[
360local b = false
361if not b then
362 if not b then
363 if not b then
364 error 'test'
365 end
366 end
367end]], 5)
368
369
353if not _soft then 370if not _soft then
354 -- several tests that exaust the Lua stack 371 -- several tests that exaust the Lua stack
355 collectgarbage() 372 collectgarbage()