diff options
Diffstat (limited to '')
-rw-r--r-- | testes/errors.lua | 16 |
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) |
314 | end | 314 | end |
315 | 315 | ||
316 | 316 | ||
@@ -489,6 +489,14 @@ if not b then | |||
489 | end | 489 | end |
490 | end]], 5) | 490 | end]], 5) |
491 | 491 | ||
492 | lineerror([[ | ||
493 | _ENV = 1 | ||
494 | global function foo () | ||
495 | local a = 10 | ||
496 | return a | ||
497 | end | ||
498 | ]], 2) | ||
499 | |||
492 | 500 | ||
493 | -- bug in 5.4.0 | 501 | -- bug in 5.4.0 |
494 | lineerror([[ | 502 | lineerror([[ |
@@ -507,7 +515,7 @@ end | |||
507 | 515 | ||
508 | 516 | ||
509 | if not _soft then | 517 | if 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 |
736 | s = "\nfunction foo ()\n local " | 744 | s = "\nfunction foo ()\n local " |
737 | for j = 1,300 do | 745 | for j = 1,200 do |
738 | s = s.."a"..j..", " | 746 | s = s.."a"..j..", " |
739 | end | 747 | end |
740 | s = s.."b\n" | 748 | s = s.."b\n" |