aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.lua')
-rwxr-xr-xtests/test.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 270f63a..fc373f6 100755
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -515,6 +515,18 @@ local cjson_tests = {
515 { "Decode (safe) error generation after new()", 515 { "Decode (safe) error generation after new()",
516 function(...) return json_safe.new().decode(...) end, { "Oops" }, 516 function(...) return json_safe.new().decode(...) end, { "Oops" },
517 true, { nil, "Expected value but found invalid token at character 1" } }, 517 true, { nil, "Expected value but found invalid token at character 1" } },
518 { "Set encode_escape_forward_slash on a cjson instance should not affect other instances",
519 function()
520 local j1 = json.new()
521 local r1 = j1.encode("/")
522
523 local j2 = json.new()
524 j2.encode_escape_forward_slash(false)
525 local r2 = j2.encode("/")
526 local r3 = j1.encode("/")
527 return r1, r2, r3
528 end, { },
529 true, { [["\/"]], [["/"]], [["\/"]] } },
518} 530}
519 531
520print(("==> Testing Lua CJSON version %s\n"):format(json._VERSION)) 532print(("==> Testing Lua CJSON version %s\n"):format(json._VERSION))