diff options
Diffstat (limited to 'testes/gc.lua')
| -rw-r--r-- | testes/gc.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testes/gc.lua b/testes/gc.lua index 03093e34..f017f330 100644 --- a/testes/gc.lua +++ b/testes/gc.lua | |||
| @@ -301,6 +301,16 @@ collectgarbage() | |||
| 301 | assert(next(a) == string.rep('$', 11)) | 301 | assert(next(a) == string.rep('$', 11)) |
| 302 | 302 | ||
| 303 | 303 | ||
| 304 | if T then -- bug since 5.3: all-weak tables are not being revisited | ||
| 305 | T.gcstate("propagate") | ||
| 306 | local t = setmetatable({}, {__mode = "kv"}) | ||
| 307 | T.gcstate("atomic") -- 't' was visited | ||
| 308 | setmetatable(t, {__mode = "kv"}) | ||
| 309 | T.gcstate("pause") -- its new metatable is not being visited | ||
| 310 | assert(getmetatable(t).__mode == "kv") | ||
| 311 | end | ||
| 312 | |||
| 313 | |||
| 304 | -- 'bug' in 5.1 | 314 | -- 'bug' in 5.1 |
| 305 | a = {} | 315 | a = {} |
| 306 | local t = {x = 10} | 316 | local t = {x = 10} |
