Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.lua')
-rwxr-xr-xtests/test.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 96a3201..b8fce84 100755
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -261,10 +261,10 @@ local cjson_tests = {
json.encode_invalid_numbers, { false }, true, { false } },
{ "Encode NaN [throw error]",
json.encode, { NaN },
- false, { "Cannot serialise number: must not be NaN or Inf" } },
+ false, { "Cannot serialise number: must not be NaN or Infinity" } },
{ "Encode Infinity [throw error]",
json.encode, { Inf },
- false, { "Cannot serialise number: must not be NaN or Inf" } },
+ false, { "Cannot serialise number: must not be NaN or Infinity" } },
{ "Set encode_invalid_numbers(\"null\")",
json.encode_invalid_numbers, { "null" }, true, { "null" } },
{ "Encode NaN as null",
@@ -274,9 +274,11 @@ local cjson_tests = {
{ "Set encode_invalid_numbers(true)",
json.encode_invalid_numbers, { true }, true, { true } },
{ "Encode NaN",
- json.encode, { NaN }, true, { "nan" } },
- { "Encode Infinity",
- json.encode, { Inf }, true, { "inf" } },
+ json.encode, { NaN }, true, { "NaN" } },
+ { "Encode +Infinity",
+ json.encode, { Inf }, true, { "Infinity" } },
+ { "Encode -Infinity",
+ json.encode, { -Inf }, true, { "-Infinity" } },
{ 'Set encode_invalid_numbers("off")',
json.encode_invalid_numbers, { "off" }, true, { false } },