From 7d15336745680ae32f6932b7fffc4cac3a8ac5e7 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 6 Sep 2026 20:26:18 +0200 Subject: [PATCH] Use a raw string literal for the multi-line error-position test input Signed-off-by: Niels Lohmann --- tests/src/unit-class_parser.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/src/unit-class_parser.cpp b/tests/src/unit-class_parser.cpp index d30146dbe..b811ee30c 100644 --- a/tests/src/unit-class_parser.cpp +++ b/tests/src/unit-class_parser.cpp @@ -1536,7 +1536,14 @@ TEST_CASE("parser class") // an invalid token appearing after several indented, multi-line // whitespace runs vs. the same document without any of that // whitespace - check_error("{\n \"a\": 1,\n \"b\": [\n true,\n false\n ],\n \"c\": @\n}", 70, + check_error(R"({ + "a": 1, + "b": [ + true, + false + ], + "c": @ +})", 70, "[json.exception.parse_error.101] parse error at line 7, column 10: syntax error while parsing value - invalid literal; last read: '\"c\": @'"); check_error("{\"a\":1,\"b\":[true,false],\"c\":@}", 29, "[json.exception.parse_error.101] parse error at line 1, column 29: syntax error while parsing value - invalid literal; last read: '\"c\":@'");