mirror of
https://github.com/nlohmann/json.git
synced 2026-03-10 19:21:26 +00:00
Refactor unit tests to use more convenient doctest assertion macros (#3393)
* Add missing check * Refactor assertions in unit-algorithms.cpp * Refactor assertions in unit-bson.cpp * Refactor assertions in unit-cbor.cpp * Refactor assertions in unit-class_const_iterator.cpp * Refactor assertions in unit-class_iterator.cpp * Refactor assertions in unit-class_parser.cpp * Refactor assertions in unit-constructor1.cpp * Refactor assertions in unit-convenience.cpp * Refactor assertions in unit-conversions.cpp * Refactor assertions in unit-deserialization.cpp * Refactor assertions in unit-element_access1.cpp * Refactor assertions in unit-element_access2.cpp * Refactor assertions in unit-iterators1.cpp * Refactor assertions in unit-iterators2.cpp * Refactor assertions in unit-json_patch.cpp * Refactor assertions in unit-json_pointer.cpp * Refactor assertions in unit-modifiers.cpp * Refactor assertions in unit-msgpack.cpp * Refactor assertions in unit-reference_access.cpp * Refactor assertions in unit-regression1.cpp * Refactor assertions in unit-serialization.cpp * Refactor assertions in unit-ubjson.cpp * Refactor assertions in unit-unicode1.cpp * Apply formatting
This commit is contained in:
committed by
GitHub
parent
ad103e5b45
commit
ce35256825
@@ -107,33 +107,19 @@ TEST_CASE("Unicode (1/5)" * doctest::skip())
|
||||
{
|
||||
json _;
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uDC00\\uDC00\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uDC00\\uDC00\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF; last read: '\"\\uDC00'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uDC00\\uDC00\""), "[json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF; last read: '\"\\uDC00'", json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uD7FF\\uDC00\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uD7FF\\uDC00\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF; last read: '\"\\uD7FF\\uDC00'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD7FF\\uDC00\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+DC00..U+DFFF must follow U+D800..U+DBFF; last read: '\"\\uD7FF\\uDC00'", json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uD800]\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uD800]\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800]'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD800]\""), "[json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800]'", json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\v\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\v\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 9: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\v'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD800\\v\""), "[json.exception.parse_error.101] parse error at line 1, column 9: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\v'", json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\u123\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\u123\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: '\\u' must be followed by 4 hex digits; last read: '\"\\uD800\\u123\"'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD800\\u123\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: '\\u' must be followed by 4 hex digits; last read: '\"\\uD800\\u123\"'", json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\uDBFF\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\uDBFF\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\uDBFF'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD800\\uDBFF\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\uDBFF'", json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(_ = json::parse("\"\\uD800\\uE000\""), json::parse_error&);
|
||||
CHECK_THROWS_WITH(_ = json::parse("\"\\uD800\\uE000\""),
|
||||
"[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\uE000'");
|
||||
CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD800\\uE000\""), "[json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value - invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; last read: '\"\\uD800\\uE000'", json::parse_error&);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user