aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-01-14 23:39:47 +0100
committerKim Alvefur <zash@zash.se>2020-01-14 23:39:47 +0100
commita0bb180c36219f617f01d42b4a49c5f38b839582 (patch)
tree80543f3a72eeb61f3f847f7bca5fd3e8d0896d36
parent20ad50db57c447158df7162a1f48c3f6ec244553 (diff)
downloadprosody-a0bb180c36219f617f01d42b4a49c5f38b839582.tar.gz
prosody-a0bb180c36219f617f01d42b4a49c5f38b839582.zip
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.
-rw-r--r--spec/util_array_spec.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/util_array_spec.lua b/spec/util_array_spec.lua
index 04d0cc28..1d9da947 100644
--- a/spec/util_array_spec.lua
+++ b/spec/util_array_spec.lua
@@ -43,6 +43,7 @@ describe("util.array", function ()
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);