diff options
Diffstat (limited to 'testes')
-rw-r--r-- | testes/events.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testes/events.lua b/testes/events.lua index 8a01330e..17a73664 100644 --- a/testes/events.lua +++ b/testes/events.lua | |||
@@ -305,6 +305,17 @@ t[Set{1,3,5}] = 1 | |||
305 | assert(t[Set{1,3,5}] == undef) | 305 | assert(t[Set{1,3,5}] == undef) |
306 | 306 | ||
307 | 307 | ||
308 | do -- test invalidating flags | ||
309 | local mt = {__eq = true} | ||
310 | local a = setmetatable({10}, mt) | ||
311 | local b = setmetatable({10}, mt) | ||
312 | mt.__eq = nil | ||
313 | assert(a ~= b) -- no metamethod | ||
314 | mt.__eq = function (x,y) return x[1] == y[1] end | ||
315 | assert(a == b) -- must use metamethod now | ||
316 | end | ||
317 | |||
318 | |||
308 | if not T then | 319 | if not T then |
309 | (Message or print)('\n >>> testC not active: skipping tests for \z | 320 | (Message or print)('\n >>> testC not active: skipping tests for \z |
310 | userdata <<<\n') | 321 | userdata <<<\n') |