summaryrefslogtreecommitdiff
path: root/tests/modules/string/serialize/test.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-25 18:31:53 +0800
committerOpportunityLiu <[email protected]>2019-07-25 18:31:53 +0800
commit5e8049c85f976305206ed2117b71168b1972704c (patch)
tree278f738b030cfeadad151c828825e692c35a0712 /tests/modules/string/serialize/test.lua
parentcb1283c1f4590aaa562ae9a472a027d27229ba84 (diff)
add some tests
Diffstat (limited to 'tests/modules/string/serialize/test.lua')
-rw-r--r--tests/modules/string/serialize/test.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/modules/string/serialize/test.lua b/tests/modules/string/serialize/test.lua
index 1e1484f98..a85868e7e 100644
--- a/tests/modules/string/serialize/test.lua
+++ b/tests/modules/string/serialize/test.lua
@@ -27,6 +27,7 @@ function test_table(t)
t:are_equal(roundtrip({1, 2, 3}), {1, 2, 3})
t:are_equal(roundtrip({1, "", 3}), {1, "", 3})
t:are_equal(roundtrip({{1, 2, 3, nil, 4}}), {{1, 2, 3, nil, 4}})
+ t:are_equal(roundtrip({{1, 2, 3, nil, 4, [100]=5}}), {{1, 2, 3, nil, 4, [100]=5}})
t:are_equal(roundtrip({{a=1, b=2, c=3, nil, 4}}), {{a=1, b=2, c=3, nil, 4}})
end
@@ -34,4 +35,6 @@ function test_function(t)
t:are_equal(roundtrip(function() return {} end)(), {})
t:are_equal(roundtrip(function() return {1, 2, 3} end)(), {1, 2, 3})
t:are_equal(roundtrip(function() return {{1, 2, 3, nil, 4}} end)(), {{1, 2, 3, nil, 4}})
+ t:are_equal(roundtrip({function() return {{1, 2, 3, nil, 4}} end})[1](), {{1, 2, 3, nil, 4}})
+ t:are_equal(roundtrip({{function() return {{1, 2, 3, nil, 4}} end}})[1][1](), {{1, 2, 3, nil, 4}})
end