summaryrefslogtreecommitdiff
path: root/tests/modules/table/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-02 23:26:00 +0800
committerruki <[email protected]>2022-03-02 23:26:00 +0800
commitaeb97fe6d7d7385fddb494dc4f4a892993e03876 (patch)
tree29d97c4b90fd0af6d841b7941bc22f288a7448b8 /tests/modules/table/test.lua
parentcfdffbc896a2999c594caccfdaa323df16e3950b (diff)
fix wrap
Diffstat (limited to 'tests/modules/table/test.lua')
-rw-r--r--tests/modules/table/test.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/modules/table/test.lua b/tests/modules/table/test.lua
index 156e619f9..5133e778f 100644
--- a/tests/modules/table/test.lua
+++ b/tests/modules/table/test.lua
@@ -16,9 +16,8 @@ function test_wrap(t)
t:are_equal(table.wrap({}), {})
t:are_equal(table.wrap({1}), {1})
t:are_equal(table.wrap({{}}), {{}})
- local a = {1}
- debug.setmetatable(a, {})
- t:are_equal(table.wrap(a), {a})
+ local a = {1, __object__ = true}
+ t:are_equal(table.wrap({a}), {a})
end
function test_unwrap(t)
@@ -27,7 +26,6 @@ function test_unwrap(t)
t:are_equal(table.unwrap({}), {})
t:are_equal(table.unwrap({1}), 1)
t:are_equal(table.unwrap({{}}), {})
- local a = {1}
- debug.setmetatable(a, {})
+ local a = {1, __object__ = true}
t:are_equal(table.unwrap(a), a)
end