aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bumped version to 2.1.0.11. (#86)Johnny Wang2023-01-191-1/+1
|
* bumped version to 2.1.0.10. (#79)2.1.0.10rc12.1.0.10Johnny Wang2021-12-101-1/+1
|
* bump version to 2.1.0.92.1.0.9leaf corcoran2021-02-151-1/+1
|
* support error message testing for modern versions of lualeaf corcoran2020-04-251-12/+56
|
* add one_of testing to avoid hash table ordering causing test to failleaf corcoran2020-04-251-1/+6
|
* bumped version to 2.1.0.6.2.1.0.6Yichun Zhang (agentzh)2018-04-191-1/+1
|
* tests: now we use luajit to run the test suite.Yichun Zhang (agentzh)2017-11-151-1/+1
|
* feature: now we allow up to 16 decimal places in JSON number encoding via ↵2.1.0.3Brandon2015-11-041-1/+1
| | | | | | | | cjson.encode_number_precision(). thanks lordnynex for the patch in #4. Test cases for changing precision
* Use Javascript compat values for Infinity/NaNMark Pulford2012-03-041-5/+7
| | | | | Use Javascript compatible values for Infinity/NaN when encoding invalid numbers.
* Bump version to 2.1develMark Pulford2012-03-041-1/+1
|
* Add cjson.safe module to suppress exceptionsMark Pulford2012-03-041-0/+14
| | | | Add cjson.safe module to suppress exceptions during JSON conversions.
* Bump version to 2.0develMark Pulford2012-03-041-1/+1
| | | | | Bump version to 2.0devel due to significant changes and updated API (runtime config not fully backwards compatible).
* Simplify string.format() callsMark Pulford2012-03-041-3/+3
| | | | Simply string.format() calls with OO method notation.
* Create separate tests for numbers w/leading zerosMark Pulford2012-03-041-3/+8
| | | | | | Create separate tests for numbers with leading zeros. This allows the earlier "normal" number test to pass. Also update hexadecimal test to use the "p" exponent format.
* Remove deprecated "refuse_invalid_numbers"Mark Pulford2012-03-041-2/+2
| | | | | | Remove deprecated "refuse_invalid_numbers" since the version number will be bumped to 1.1.0. Also remove "version" variable since it has been replaced by _VERSION.
* Bump development version to 1.1develMark Pulford2012-03-041-1/+1
|
* Disable registration of cjson global variableMark Pulford2012-03-041-1/+1
| | | | | | | Disable registration of cjson module table global variable in the default build. Automatically creating a variable in the global namespace can cause issues for other software and is no longer recommended with Lua.
* Return boolean values from configuration functionsMark Pulford2012-03-041-11/+11
| | | | | | Return boolean values from configuration functions to simplify usage in the common case. Eg,: if not cjson.encode_invalid_numbers() then .. end
* Add depth/index to decode depth error messageMark Pulford2012-03-041-2/+5
| | | | | | | | | Include depth and character index when throwing decode nesting errors. Pre-emptively add a test decoding a massively nested JSON array. Lua stack overflow faults are unlikely to occur on simple data structures. Valgrind can highlight stack allocation bugs with complicated JSON even if the test succeeds.
* Fix Lua C function stack overflow during encodingMark Pulford2012-03-041-0/+9
| | | | | | | | | Ensure there are enough Lua stack slots available before descending into another table during encoding. This fixes a segfault when encoding deeply nested tables. This bug wasn't noticed earlier due to the previous limit of 20 nested tables.
* Recommend genutf8.pl when utf8.dat is missingMark Pulford2012-03-041-1/+1
|
* Add "throw error" to test descriptionsMark Pulford2012-03-041-41/+41
| | | | | Add "throw error" to descriptions for tests which are intended to generate errors.
* Test config API errors and setting configurationMark Pulford2012-03-041-28/+66
| | | | | | | - Update comments - Use enumerated return values - Test various configuration API errors - Test resetting configuration to default
* Tidy tests and improve coverageMark Pulford2012-03-041-84/+112
| | | | | | | | | | | | - Rearrange test sections to keep more related tests together. - Test configuration functions for errors Add tests for more parts of the Lua CJSON API: - _NAME, _VERSION, version - encode_keep_buffer - encode_number_precision - decode_invalid_numbers - decode_max_depth
* Place nested data structure inline with testsMark Pulford2012-03-041-4/+2
| | | | | Make the tests more explicit, the nested data structure doesn't need to be generated in advance.
* Gather all test data into a tableMark Pulford2012-03-041-20/+32
| | | | Move all test data into a single data to tidy the main namespace.
* Add descriptions to all testsMark Pulford2012-03-041-143/+192
| | | | Rewrite test framework and add descriptions for all tests.
* Add tests for decode_max_depth()Mark Pulford2012-03-041-5/+13
|
* Add option to encode invalid numbers as "null"Mark Pulford2012-03-041-7/+14
| | | | | Deprecate and replace refuse_invalid_numbers() with encode_invalid_numbers() and decode_invalid_numbers().
* Rename "cjson-misc" module to "cjson.util"Mark Pulford2012-03-041-15/+15
|
* Convert common.lua into cjson-misc moduleMark Pulford2012-01-031-15/+15
|
* Remove redundant comment from test.luaMark Pulford2011-12-311-7/+0
|
* Remove "update_locale" Lua functionMark Pulford2011-12-311-2/+2
| | | | | | | Only update the locale when the module is initialised. cjson.new() can be used if the locale changes part way through program execution.
* Add support for Lua 5.2 and cjson.newMark Pulford2011-12-301-8/+8
| | | | | | | | | | | | | | 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.
* Add fpconv to work around comma decimal pointsMark Pulford2011-12-301-0/+2
| | | | | | | | Create a separate buffer and translate comma <> dot before calling strtod(), and after calling sprintf() as required. - Add "update_locale" Lua API call and init locale on module load. - Move sprintf format string to fpconv
* Display success when all tests passMark Pulford2011-12-301-3/+4
|
* Display failed test count (test.lua)Mark Pulford2011-12-261-1/+1
|
* Update build testing to show test counts/failuresMark Pulford2011-12-131-0/+8
| | | | | Display failed tests, and successful/total test counts. Use "awk" to provide a portable "ggrep -E" with context.
* 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
|