mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-30 02:37:35 +02:00
Tests: trim trailing white spaces
This commit is contained in:
@ -366,7 +366,7 @@ TEST_CASE("Filtering") {
|
|||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// bubble up element error even if array is skipped
|
// bubble up element error even if array is skipped
|
||||||
"[1,'2,3]",
|
"[1,'2,3]",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
@ -375,7 +375,7 @@ TEST_CASE("Filtering") {
|
|||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// bubble up member error even if object is skipped
|
// bubble up member error even if object is skipped
|
||||||
"{'hello':'worl}",
|
"{'hello':'worl}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
@ -384,7 +384,7 @@ TEST_CASE("Filtering") {
|
|||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// bubble up colon error even if object is skipped
|
// bubble up colon error even if object is skipped
|
||||||
"{'hello','world'}",
|
"{'hello','world'}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
@ -393,7 +393,7 @@ TEST_CASE("Filtering") {
|
|||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// bubble up key error even if object is skipped
|
// bubble up key error even if object is skipped
|
||||||
"{'hello:1}",
|
"{'hello:1}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
@ -404,7 +404,7 @@ TEST_CASE("Filtering") {
|
|||||||
{
|
{
|
||||||
// detect invalid value in skipped object
|
// detect invalid value in skipped object
|
||||||
"{'hello':!}",
|
"{'hello':!}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
@ -413,235 +413,235 @@ TEST_CASE("Filtering") {
|
|||||||
{
|
{
|
||||||
// ignore invalid value in skipped object
|
// ignore invalid value in skipped object
|
||||||
"{'hello':\\}",
|
"{'hello':\\}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// check nesting limit even for ignored objects
|
// check nesting limit even for ignored objects
|
||||||
"{}",
|
"{}",
|
||||||
"false",
|
"false",
|
||||||
0,
|
0,
|
||||||
DeserializationError::TooDeep,
|
DeserializationError::TooDeep,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// check nesting limit even for ignored objects
|
// check nesting limit even for ignored objects
|
||||||
"{'hello':{}}",
|
"{'hello':{}}",
|
||||||
"false",
|
"false",
|
||||||
1,
|
1,
|
||||||
DeserializationError::TooDeep,
|
DeserializationError::TooDeep,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// check nesting limit even for ignored values in objects
|
// check nesting limit even for ignored values in objects
|
||||||
"{'hello':{}}",
|
"{'hello':{}}",
|
||||||
"{}",
|
"{}",
|
||||||
1,
|
1,
|
||||||
DeserializationError::TooDeep,
|
DeserializationError::TooDeep,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// check nesting limit even for ignored arrays
|
// check nesting limit even for ignored arrays
|
||||||
"[]",
|
"[]",
|
||||||
"false",
|
"false",
|
||||||
0,
|
0,
|
||||||
DeserializationError::TooDeep,
|
DeserializationError::TooDeep,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// check nesting limit even for ignored arrays
|
// check nesting limit even for ignored arrays
|
||||||
"[[]]",
|
"[[]]",
|
||||||
"false",
|
"false",
|
||||||
1,
|
1,
|
||||||
DeserializationError::TooDeep,
|
DeserializationError::TooDeep,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// check nesting limit even for ignored values in arrays
|
// check nesting limit even for ignored values in arrays
|
||||||
"[[]]",
|
"[[]]",
|
||||||
"[]",
|
"[]",
|
||||||
1,
|
1,
|
||||||
DeserializationError::TooDeep,
|
DeserializationError::TooDeep,
|
||||||
"[]",
|
"[]",
|
||||||
JSON_ARRAY_SIZE(0)
|
JSON_ARRAY_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// supports back-slash at the end of skipped string
|
// supports back-slash at the end of skipped string
|
||||||
"\"hell\\",
|
"\"hell\\",
|
||||||
"false",
|
"false",
|
||||||
1,
|
1,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment at after an element in a skipped array
|
// invalid comment at after an element in a skipped array
|
||||||
"[1/]",
|
"[1/]",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete comment at after an element in a skipped array
|
// incomplete comment at after an element in a skipped array
|
||||||
"[1/*]",
|
"[1/*]",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// missing comma in a skipped array
|
// missing comma in a skipped array
|
||||||
"[1 2]",
|
"[1 2]",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment at the beginning of array
|
// invalid comment at the beginning of array
|
||||||
"[/1]",
|
"[/1]",
|
||||||
"[false]",
|
"[false]",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"[]",
|
"[]",
|
||||||
JSON_ARRAY_SIZE(0)
|
JSON_ARRAY_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete comment at the begining of an array
|
// incomplete comment at the begining of an array
|
||||||
"[/*]",
|
"[/*]",
|
||||||
"[false]",
|
"[false]",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"[]",
|
"[]",
|
||||||
JSON_ARRAY_SIZE(0)
|
JSON_ARRAY_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment before key
|
// invalid comment before key
|
||||||
"{/1:2}",
|
"{/1:2}",
|
||||||
"{}",
|
"{}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete comment before key
|
// incomplete comment before key
|
||||||
"{/*:2}",
|
"{/*:2}",
|
||||||
"{}",
|
"{}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment after key
|
// invalid comment after key
|
||||||
"{\"example\"/1:2}",
|
"{\"example\"/1:2}",
|
||||||
"{}",
|
"{}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete comment after key
|
// incomplete comment after key
|
||||||
"{\"example\"/*:2}",
|
"{\"example\"/*:2}",
|
||||||
"{}",
|
"{}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment after colon
|
// invalid comment after colon
|
||||||
"{\"example\":/12}",
|
"{\"example\":/12}",
|
||||||
"{}",
|
"{}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete comment after colon
|
// incomplete comment after colon
|
||||||
"{\"example\":/*2}",
|
"{\"example\":/*2}",
|
||||||
"{}",
|
"{}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// comment next to an integer
|
// comment next to an integer
|
||||||
"{\"ignore\":1//,\"example\":2\n}",
|
"{\"ignore\":1//,\"example\":2\n}",
|
||||||
"{\"example\":true}",
|
"{\"example\":true}",
|
||||||
10,
|
10,
|
||||||
DeserializationError::Ok,
|
DeserializationError::Ok,
|
||||||
"{}",
|
"{}",
|
||||||
JSON_OBJECT_SIZE(0)
|
JSON_OBJECT_SIZE(0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment after opening brace of a skipped object
|
// invalid comment after opening brace of a skipped object
|
||||||
"{/1:2}",
|
"{/1:2}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete after opening brace of a skipped object
|
// incomplete after opening brace of a skipped object
|
||||||
"{/*:2}",
|
"{/*:2}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment after key of a skipped object
|
// invalid comment after key of a skipped object
|
||||||
"{\"example\"/:2}",
|
"{\"example\"/:2}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete after after key of a skipped object
|
// incomplete after after key of a skipped object
|
||||||
"{\"example\"/*:2}",
|
"{\"example\"/*:2}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// invalid comment after value in a skipped object
|
// invalid comment after value in a skipped object
|
||||||
"{\"example\":2/}",
|
"{\"example\":2/}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::InvalidInput,
|
DeserializationError::InvalidInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// incomplete after after value of a skipped object
|
// incomplete after after value of a skipped object
|
||||||
"{\"example\":2/*}",
|
"{\"example\":2/*}",
|
||||||
"false",
|
"false",
|
||||||
10,
|
10,
|
||||||
DeserializationError::IncompleteInput,
|
DeserializationError::IncompleteInput,
|
||||||
"null",
|
"null",
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
}; // clang-format on
|
}; // clang-format on
|
||||||
|
Reference in New Issue
Block a user