mirror of
https://github.com/nlohmann/json.git
synced 2026-10-17 19:48:12 +00:00
Fix CI: keep raw strings with backslashes out of test macros for MSVC
MSVC stringizes the arguments of doctest's CHECK() so that a raw string literal becomes an ordinary one, and then reported the "\q" in the new alt_string recovery test as warning C4129, an error with /WX. The input is now a variable. The same pattern with "\u0000" in the parser's recovery test is replaced by a JSON value built from a std::string. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -3268,7 +3268,7 @@ TEST_CASE("parser error recovery (#3989)")
|
||||
const auto in_string = parse_recovering(std::string("[\"a\0b\"]", 7));
|
||||
CHECK(in_string.balanced);
|
||||
#ifdef JSON_TEST_STRICT_NUL_HANDLING_ENABLED
|
||||
CHECK(in_string.value == json::parse(R"(["a\u0000b"])"));
|
||||
CHECK(in_string.value == json::array({std::string("a\0b", 3)}));
|
||||
#else
|
||||
CHECK(in_string.value == json::parse(R"(["a"])"));
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user