dota17
5fe4448541
update tsetcase for tokener_c
5 years ago
chenguoping
1446572997
add testcases of object and token
5 years ago
Eric Haszlakiewicz
da4b34355d
Add an parse test for content starting with a UTF8 BOM, which is _not_ a valid start to a JSON message.
7 years ago
Eric Haszlakiewicz
9c9529f798
Update test_parse.expected to match the code.
7 years ago
Eric Haszlakiewicz
ba11d334db
Save proper expected output for test_parse from the previous commit.
7 years ago
Eric Haszlakiewicz
4d1e0b4409
Issue #371 : fix parsing of "-Infinity" (although in a somewhat different location than PR#372 used), and add a case to test_parse to check for this.
7 years ago
Eric Haszlakiewicz
2a22858fe7
Add a few extra cases to test_parse to show how trailing bytes are handled, especially for parsing "Infinity".
7 years ago
Eric Haszlakiewicz
b8738dd623
Rewrite test_basic_parse() to factor out a single_basic_parse() to avoid lots of duplicate boiler plate code.
Also, emit the input string in the output so it's easier to see what's going on.
7 years ago
Eric Haszlakiewicz
8c86207258
Add a few more cases to test_parse to provide some examples of how parsing works; should help address the questions raised in Issue #302 .
8 years ago
Jan Gerhards
ca7a1973e2
bugfix: floating point representaion without fractional part
closes https://github.com/json-c/json-c/issues/278
8 years ago
Eric Haszlakiewicz
33339ae595
Use json_visit() to clear the serializer data set when parsing so the output from test_parse reflects the actual values parsed.
9 years ago
Eric Haszlakiewicz
36a28fcb0c
Issue #275 : fix out of bounds read when handling unicode surrogate pairs.
9 years ago
Eric Haszlakiewicz
316da85818
Fix issue #201 : add a JSON_C_TO_STRING_NOSLASHESCAPE flag to turn off escaping of forward slashes.
9 years ago
chl
99d8fc975e
Tightening the number parsing algorithm
Some badly formated "numbers" could get partly parsed,
resulting in truncated results instead of raising an
error.
Examples :
'1.2.3' -> (double)1.2
'2015-01-15' -> (int)2015
This patch is not perfect (ex: input can still end with a 'E', which
is forbidden by json.org doc) but should avoid non-sensically
formated input.
Tests added.
10 years ago
Eric Haszlakiewicz
05da316b9c
Issue #103 : allow Infinity and -Infinity to be parsed.
11 years ago
Eric Haszlakiewicz
0eedf3802f
Issue#102 - add support for parsing "NaN".
11 years ago
Eric Haszlakiewicz
51993c28c2
Added a json_object_new_double_s() convenience function to allow an exact string representation of a double to be specified when creating the object and use it in json_tokener_parse_ex() so a re-serialized object more exactly matches the input.
Add json_object_free_userdata() and json_object_userdata_to_json_string() too.
12 years ago
Eric Haszlakiewicz
e8161a11bb
Issue #15 : add a way to set a JSON_TOKENER_STRICT flag to forbid commas at the end of arrays and objects.
12 years ago
Iskren Chernev
78b089bc1e
Fixed test_parse for \f
12 years ago
Eric Haszlakiewicz
92f31bd99a
Handle the \f escape sequence (the two characters: backslash followed by an f, not a literal formfeed) and extend the test_parse test to check all valid escape sequences.
13 years ago
Eric Haszlakiewicz
c1b8891a13
Move the rest of the tests into the tests subdirectory.
13 years ago