aboutsummaryrefslogtreecommitdiff
path: root/testes/errors.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/errors.lua')
-rw-r--r--testes/errors.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/testes/errors.lua b/testes/errors.lua
index c1c40fec..4230a352 100644
--- a/testes/errors.lua
+++ b/testes/errors.lua
@@ -303,14 +303,14 @@ do
303 local f = function (a) return a + 1 end 303 local f = function (a) return a + 1 end
304 f = assert(load(string.dump(f, true))) 304 f = assert(load(string.dump(f, true)))
305 assert(f(3) == 4) 305 assert(f(3) == 4)
306 checkerr("^%?:%-1:", f, {}) 306 checkerr("^%?:%?:", f, {})
307 307
308 -- code with a move to a local var ('OP_MOV A B' with A<B) 308 -- code with a move to a local var ('OP_MOV A B' with A<B)
309 f = function () local a; a = {}; return a + 2 end 309 f = function () local a; a = {}; return a + 2 end
310 -- no debug info (so that 'a' is unknown) 310 -- no debug info (so that 'a' is unknown)
311 f = assert(load(string.dump(f, true))) 311 f = assert(load(string.dump(f, true)))
312 -- symbolic execution should not get lost 312 -- symbolic execution should not get lost
313 checkerr("^%?:%-1:.*table value", f) 313 checkerr("^%?:%?:.*table value", f)
314end 314end
315 315
316 316
@@ -489,6 +489,14 @@ if not b then
489 end 489 end
490end]], 5) 490end]], 5)
491 491
492lineerror([[
493_ENV = 1
494global function foo ()
495 local a = 10
496 return a
497end
498]], 2)
499
492 500
493-- bug in 5.4.0 501-- bug in 5.4.0
494lineerror([[ 502lineerror([[
@@ -507,7 +515,7 @@ end
507 515
508 516
509if not _soft then 517if not _soft then
510 -- several tests that exaust the Lua stack 518 -- several tests that exhaust the Lua stack
511 collectgarbage() 519 collectgarbage()
512 print"testing stack overflow" 520 print"testing stack overflow"
513 local C = 0 521 local C = 0
@@ -734,7 +742,7 @@ assert(c > 255 and string.find(b, "too many upvalues") and
734 742
735-- local variables 743-- local variables
736s = "\nfunction foo ()\n local " 744s = "\nfunction foo ()\n local "
737for j = 1,300 do 745for j = 1,200 do
738 s = s.."a"..j..", " 746 s = s.."a"..j..", "
739end 747end
740s = s.."b\n" 748s = s.."b\n"