diff options
Diffstat (limited to 'testes')
-rw-r--r-- | testes/api.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testes/api.lua b/testes/api.lua index b7e34f7f..21f703fd 100644 --- a/testes/api.lua +++ b/testes/api.lua | |||
@@ -416,6 +416,10 @@ do | |||
416 | -- trivial error | 416 | -- trivial error |
417 | assert(T.checkpanic("pushstring hi; error") == "hi") | 417 | assert(T.checkpanic("pushstring hi; error") == "hi") |
418 | 418 | ||
419 | -- thread status inside panic (bug in 5.4.4) | ||
420 | assert(T.checkpanic("pushstring hi; error", "threadstatus; return 2") == | ||
421 | "ERRRUN") | ||
422 | |||
419 | -- using the stack inside panic | 423 | -- using the stack inside panic |
420 | assert(T.checkpanic("pushstring hi; error;", | 424 | assert(T.checkpanic("pushstring hi; error;", |
421 | [[checkstack 5 XX | 425 | [[checkstack 5 XX |
@@ -433,6 +437,21 @@ do | |||
433 | assert(T.checkpanic("newuserdata 20000") == MEMERRMSG) | 437 | assert(T.checkpanic("newuserdata 20000") == MEMERRMSG) |
434 | T.totalmem(0) -- restore high limit | 438 | T.totalmem(0) -- restore high limit |
435 | 439 | ||
440 | -- memory error + thread status | ||
441 | local x = T.checkpanic( | ||
442 | [[ alloccount 0 # force a memory error in next line | ||
443 | newtable | ||
444 | ]], | ||
445 | [[ | ||
446 | alloccount -1 # allow free allocations again | ||
447 | pushstring XX | ||
448 | threadstatus | ||
449 | concat 2 # to make sure message came from here | ||
450 | return 1 | ||
451 | ]]) | ||
452 | T.alloccount() | ||
453 | assert(x == "XX" .. "not enough memory") | ||
454 | |||
436 | -- stack error | 455 | -- stack error |
437 | if not _soft then | 456 | if not _soft then |
438 | local msg = T.checkpanic[[ | 457 | local msg = T.checkpanic[[ |