Software /
code /
prosody
Changeset
10590:257dc26e8e65
util.array: Add a test case for a behavior change in Lua 5.3
In Lua 5.1 and 5.2 the __eq metamethod is not invoked if the other
argument is of a different metatable, but in Lua 5.3 it is.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 14 Jan 2020 23:39:47 +0100 |
parents | 10589:3540118699cf |
children | 10591:d78c5c9b0cf6 |
files | spec/util_array_spec.lua |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/util_array_spec.lua Sun Jan 12 20:36:21 2020 +0100 +++ b/spec/util_array_spec.lua Tue Jan 14 23:39:47 2020 +0100 @@ -43,6 +43,7 @@ local b = array({ "c", "d" }); assert.truthy(a1 == a2); assert.falsy(a1 == b); + assert.falsy(a1 == { "a", "b" }, "Behavior of metatables changed in Lua 5.3"); end); end);