mirror of
https://github.com/json-c/json-c.git
synced 2026-03-24 15:39:07 +08:00
add the disabling formatting coments and adjust the partial code manuly
This commit is contained in:
@@ -32,30 +32,32 @@ static const char *input_json_str = "{ "
|
||||
"'m~n': 8 "
|
||||
"}";
|
||||
|
||||
|
||||
static const char *rec_input_json_str = "{"
|
||||
"'arr' : ["
|
||||
"{"
|
||||
"'obj': ["
|
||||
"{},{},"
|
||||
"{"
|
||||
"'obj1': 0,"
|
||||
"'obj2': \"1\""
|
||||
"}"
|
||||
"]"
|
||||
"}"
|
||||
"],"
|
||||
"'obj' : {"
|
||||
"'obj': {"
|
||||
"'obj': ["
|
||||
"{"
|
||||
"'obj1': 0,"
|
||||
"'obj2': \"1\""
|
||||
"}"
|
||||
"]"
|
||||
"}"
|
||||
"}"
|
||||
"}";
|
||||
/* clang-format off */
|
||||
static const char *rec_input_json_str =
|
||||
"{"
|
||||
"'arr' : ["
|
||||
"{"
|
||||
"'obj': ["
|
||||
"{},{},"
|
||||
"{"
|
||||
"'obj1': 0,"
|
||||
"'obj2': \"1\""
|
||||
"}"
|
||||
"]"
|
||||
"}"
|
||||
"],"
|
||||
"'obj' : {"
|
||||
"'obj': {"
|
||||
"'obj': ["
|
||||
"{"
|
||||
"'obj1': 0,"
|
||||
"'obj2': \"1\""
|
||||
"}"
|
||||
"]"
|
||||
"}"
|
||||
"}"
|
||||
"}";
|
||||
/* clang-format on */
|
||||
|
||||
/* Example from RFC */
|
||||
static void test_example_get()
|
||||
@@ -67,6 +69,7 @@ static void test_example_get()
|
||||
int i;
|
||||
};
|
||||
/* Create a map to iterate over for the ints */
|
||||
/* clang-format off */
|
||||
struct json_pointer_map_s_i json_pointers[] = {
|
||||
{ "/", 0 },
|
||||
{ "/a~1b", 1 },
|
||||
@@ -79,6 +82,7 @@ static void test_example_get()
|
||||
{ "/m~0n", 8 },
|
||||
{ NULL, 0}
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
jo1 = json_tokener_parse(input_json_str);
|
||||
assert(NULL != jo1);
|
||||
|
||||
@@ -310,8 +310,9 @@ struct incremental_step {
|
||||
{ "fail", 5, 2, json_tokener_error_parse_boolean, 1 },
|
||||
|
||||
/* Although they may initially look like they should fail,
|
||||
the next few tests check that parsing multiple sequential
|
||||
json objects in the input works as expected */
|
||||
* the next few tests check that parsing multiple sequential
|
||||
* json objects in the input works as expected
|
||||
*/
|
||||
{ "null123", 9, 4, json_tokener_success, 0 },
|
||||
{ &"null123"[4], 4, 3, json_tokener_success, 1 },
|
||||
{ "nullx", 5, 4, json_tokener_success, 0 },
|
||||
@@ -357,8 +358,9 @@ struct incremental_step {
|
||||
{ "[,1]", -1, 1, json_tokener_error_parse_unexpected, 1 },
|
||||
|
||||
/* This behaviour doesn't entirely follow the json spec, but until we have
|
||||
a way to specify how strict to be we follow Postel's Law and be liberal
|
||||
in what we accept (up to a point). */
|
||||
* a way to specify how strict to be we follow Postel's Law and be liberal
|
||||
* in what we accept (up to a point).
|
||||
*/
|
||||
{ "[1,2,3,]", -1, -1, json_tokener_success, 0 },
|
||||
{ "[1,2,,3,]", -1, 5, json_tokener_error_parse_unexpected, 0 },
|
||||
|
||||
|
||||
Reference in New Issue
Block a user