Lua query fixes

This commit is contained in:
Zef Hemel
2025-01-16 15:33:18 +01:00
parent 396c9fc60a
commit 55f5a465c8
13 changed files with 269 additions and 73 deletions
+4 -2
View File
@@ -142,7 +142,9 @@ assert_equal(t.foo, "Key not found: foo")
t = setmetatable(
{}, {
__newindex = function(table, key, value)
print("Raw set", key, value)
rawset(table, key, "Value: " .. value)
print("Raw set done")
end
}
)
@@ -150,8 +152,8 @@ t = setmetatable(
t.name = "John"
-- rawset ignores the metamethod
rawset(t, "age", 100)
assert(t.name == "Value: John")
assert(t.age == 100)
assert_equal(t.name, "Value: John")
assert_equal(t.age, 100)
-- Test some of the operator metamethods
t = setmetatable(