aboutsummaryrefslogtreecommitdiff
path: root/tests/common.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Convert common.lua into cjson-misc moduleMark Pulford2012-01-031-244/+0
|
* Add support for Lua 5.2 and cjson.newMark Pulford2011-12-301-3/+3
| | | | | | | | | | | | | | Update all Lua scripts to use new module init style everywhere: local json = require "cjson" Lua CJSON does not register a global table under Lua 5.2. The global table can be disabled under Lua 5.1 with DISABLE_CJSON_GLOBAL. Other changes: - Store CJSON configuration as an upvalue for each function. - Add "cjson.new" function to create another module table with a separate configuration. - Add _NAME and _VERSION variables.
* Update build testing to show test counts/failuresMark Pulford2011-12-131-2/+12
| | | | | Display failed tests, and successful/total test counts. Use "awk" to provide a portable "ggrep -E" with context.
* Add support for stdin to encode.lua/decode.luaMark Pulford2011-05-161-8/+25
|
* Move all benchmark code into bench.luaMark Pulford2011-05-161-39/+0
| | | | | Move benchmark() into bench.lua since it not used elsewhere. Replace posix.gettimeofday() with socket.gettime() to improve portability.
* Warn that a failed NaN test may not be an errorMark Pulford2011-05-161-1/+3
| | | | | | | 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.
* Remove trailing whitespace1.0.1Mark Pulford2011-05-101-1/+1
|
* run_test_group(): Change helper functions to localMark Pulford2011-05-101-2/+2
|
* Suspend the garbage collector during benchmarksMark Pulford2011-05-101-1/+2
| | | | Suspending GC appears to make the benchmark results more consistent.
* Add extra encoding/nesting testsMark Pulford2011-05-101-5/+13
| | | | | | - Use pcall() to call test config functions. - Test encoding with refuse_invalid_numbers() options. - Test encoding invalid types.
* Add test for excessive nesting during encodeMark Pulford2011-05-081-6/+11
|
* Add UTF-16 surrogate pair decode supportMark Pulford2011-05-081-0/+4
| | | | | | | | - Add tests for UTF-16 decoding and failures - Add getutf8.pl to assist with UTF-16 decode testing - Re-add test_decode_cycle() which was accidentally removed earlier - Rename bytestring.dat to octets-escaped.dat
* Implement data driven test frameworkMark Pulford2011-05-081-21/+147
| | | | | | | | - Add run_test(): Test a function and verify its output - Add run_test_group(): Execute a test batch - Add serialise_value(): Serialise a Lua value into the Lua syntax - Add file_save() helper function - Add NaN comparison support to compare_values()
* Add test to compare objects after decode/encodeMark Pulford2011-05-071-0/+31
|
* Add basic JSON tests and benchmarkMark Pulford2011-05-031-0/+79