aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add automated build testing (LuaRocks, Makefile)Mark Pulford2011-11-291-1/+1
|
* Add workaround to handle platforms that print -nanMark Pulford2011-11-291-4/+0
|
* Support locales which use comma decimal separatorsMark Pulford2011-10-051-0/+16
| | | | | | | | | | | | | Some locales (cs_CZ, de_DE,..) use a comma as their decimal separator. This causes CJSON to generate incorrect JSON (Eg, [10,1]), and fail when parsing some valid JSON (Eg, [10,"test"]). Added USE_POSIX_LOCALE #define which harnesses the thread-safe POSIX.1-2008 locale support (newlocale(), uselocale(), freelocale()) to temporarily use the POSIX locale during JSON conversion. Some older POSIX operating systems with xlocale.h (MacOSX) are also supported.
* Fix detection of objects with numeric string keysMark Pulford2011-08-101-2/+3
| | | | | | | | | | | | lua_array_length() recognised some objects with numeric string keys as arrays since it was incorrectly using lua_isnumber(). When an object was incorrectly recognised as an array, json_append_array() would not find any entries and generate a result like: [null,null,...] Reported by: Zhang "agentzh" Yichun <agentzh@gmail.com>
* Display CJSON library version when testingMark Pulford2011-05-291-1/+3
|
* Test module with invalid numbers enabledMark Pulford2011-05-161-2/+1
|
* Warn that a failed NaN test may not be an errorMark Pulford2011-05-161-2/+6
| | | | | | | 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-3/+3
|
* Add runtime option for persistent encode bufferMark Pulford2011-05-101-1/+1
|
* Remove whitespace from generated JSON outputMark Pulford2011-05-101-5/+5
| | | | | | | Remove excess whitespace to reduce output size and increase encode performance. Suggested by: Zhang "agentzh" Yichun <agentzh@gmail.com>
* Add extra encoding/nesting testsMark Pulford2011-05-101-1/+30
| | | | | | - 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-0/+5
|
* Add NaN/Inf encoding tests, rearrange test orderMark Pulford2011-05-081-71/+74
|
* Generate error when attempting to decode UTF-16/32Mark Pulford2011-05-081-0/+4
|
* Add UTF-16 surrogate pair decode supportMark Pulford2011-05-081-2/+64
| | | | | | | | - 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
* Test octect encode/decode separatelyMark Pulford2011-05-081-24/+8
|
* Convert tests to automatically verify outputMark Pulford2011-05-081-106/+107
|
* Implement data driven test frameworkMark Pulford2011-05-081-0/+4
| | | | | | | | - 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-3/+9
|
* Add basic JSON tests and benchmarkMark Pulford2011-05-031-0/+132