summaryrefslogtreecommitdiff
path: root/tests/modules/json/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-07 22:03:49 +0800
committerruki <[email protected]>2022-09-07 22:03:49 +0800
commitf16528f0e60e1823fc1aa093e5cd38f8e3406ac9 (patch)
treef7870c89528b1c6c1c81c45c3b03754d699007fb /tests/modules/json/test.lua
parentc25a0a9fc9e50be84c55ded5fe3b2bf2558791b7 (diff)
improve json tests
Diffstat (limited to 'tests/modules/json/test.lua')
-rwxr-xr-xtests/modules/json/test.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/modules/json/test.lua b/tests/modules/json/test.lua
index 7256223d4..901546259 100755
--- a/tests/modules/json/test.lua
+++ b/tests/modules/json/test.lua
@@ -4,6 +4,8 @@ import("core.base.json")
function test_json_decode(t)
t:are_equal(json.decode('{}'), {})
t:are_equal(json.decode('[]'), {})
+ t:are_equal(json.is_marked_as_array(json.decode('[]')), true)
+ t:are_equal(not json.is_marked_as_array(json.decode('{}')), true)
t:are_equal(json.decode('{"a":1, "b":"2", "c":true, "d":false, "e":null, "f":[]}'), {a = 1, b = "2", c = true, d = false, e = json.null, f = {}})
t:are_equal(json.decode('{"a":[], "b":[1,2], "c":{"a":1}}'), {a = {}, b = {1,2}, c = {a = 1}})
t:are_equal(json.decode('[1,"2"]'), {1, "2"})