aboutsummaryrefslogtreecommitdiff
path: root/tests/common.lua
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-05-16 00:08:00 +0930
committerMark Pulford <mark@kyne.com.au>2011-05-16 00:08:00 +0930
commit2cb7a17e3e5a0bab761661e193ffbea146dade73 (patch)
tree0da314b86023464d9e68070869004e8851cffb5f /tests/common.lua
parent35e81a9c4143890771553c38dce0719630b37517 (diff)
downloadlua-cjson-2cb7a17e3e5a0bab761661e193ffbea146dade73.tar.gz
lua-cjson-2cb7a17e3e5a0bab761661e193ffbea146dade73.tar.bz2
lua-cjson-2cb7a17e3e5a0bab761661e193ffbea146dade73.zip
Warn that a failed NaN test may not be an error
Sprintf returns "-nan" rather than "nan" on some platforms, which causes the test script to incorrectly flag a failure. Also allow test functions without "==> Config" output.
Diffstat (limited to 'tests/common.lua')
-rw-r--r--tests/common.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/common.lua b/tests/common.lua
index 156f882..47e3f56 100644
--- a/tests/common.lua
+++ b/tests/common.lua
@@ -231,7 +231,9 @@ end
231function run_test_group(testgroup, tests) 231function run_test_group(testgroup, tests)
232 local function run_config(configname, func) 232 local function run_config(configname, func)
233 local success, msg = pcall(func) 233 local success, msg = pcall(func)
234 print(string.format("==> Config %s: %s", configname, msg)) 234 if msg then
235 print(string.format("==> Config %s: %s", configname, msg))
236 end
235 print() 237 print()
236 end 238 end
237 239