diff options
Diffstat (limited to 'testes/gc.lua')
| -rw-r--r-- | testes/gc.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testes/gc.lua b/testes/gc.lua index 91915c0b..80850f92 100644 --- a/testes/gc.lua +++ b/testes/gc.lua | |||
| @@ -372,7 +372,7 @@ if T then | |||
| 372 | warn("@on"); warn("@store") | 372 | warn("@on"); warn("@store") |
| 373 | collectgarbage() | 373 | collectgarbage() |
| 374 | assert(string.find(_WARN, "error in __gc metamethod")) | 374 | assert(string.find(_WARN, "error in __gc metamethod")) |
| 375 | assert(string.match(_WARN, "@(.-)@") == "expected"); _WARN = nil | 375 | assert(string.match(_WARN, "@(.-)@") == "expected"); _WARN = false |
| 376 | for i = 8, 10 do assert(s[i]) end | 376 | for i = 8, 10 do assert(s[i]) end |
| 377 | 377 | ||
| 378 | for i = 1, 5 do | 378 | for i = 1, 5 do |
| @@ -481,7 +481,7 @@ if T then | |||
| 481 | u = setmetatable({}, {__gc = function () error "@expected error" end}) | 481 | u = setmetatable({}, {__gc = function () error "@expected error" end}) |
| 482 | u = nil | 482 | u = nil |
| 483 | collectgarbage() | 483 | collectgarbage() |
| 484 | assert(string.find(_WARN, "@expected error")); _WARN = nil | 484 | assert(string.find(_WARN, "@expected error")); _WARN = false |
| 485 | warn("@normal") | 485 | warn("@normal") |
| 486 | end | 486 | end |
| 487 | 487 | ||
| @@ -657,14 +657,14 @@ if T then | |||
| 657 | n = n + 1 | 657 | n = n + 1 |
| 658 | assert(n == o[1]) | 658 | assert(n == o[1]) |
| 659 | if n == 1 then | 659 | if n == 1 then |
| 660 | _WARN = nil | 660 | _WARN = false |
| 661 | elseif n == 2 then | 661 | elseif n == 2 then |
| 662 | assert(find(_WARN, "@expected warning")) | 662 | assert(find(_WARN, "@expected warning")) |
| 663 | lastmsg = _WARN -- get message from previous error (first 'o') | 663 | lastmsg = _WARN -- get message from previous error (first 'o') |
| 664 | else | 664 | else |
| 665 | assert(lastmsg == _WARN) -- subsequent error messages are equal | 665 | assert(lastmsg == _WARN) -- subsequent error messages are equal |
| 666 | end | 666 | end |
| 667 | warn("@store"); _WARN = nil | 667 | warn("@store"); _WARN = false |
| 668 | error"@expected warning" | 668 | error"@expected warning" |
| 669 | end} | 669 | end} |
| 670 | for i = 10, 1, -1 do | 670 | for i = 10, 1, -1 do |
