🚸 improve diagnostics

This commit is contained in:
Niels Lohmann
2020-06-21 13:28:00 +02:00
parent 139a0258cc
commit e22ce45065
4 changed files with 43 additions and 2 deletions

View File

@@ -1877,4 +1877,10 @@ TEST_CASE("parser class")
}
}
}
SECTION("error messages for comments")
{
CHECK_THROWS_WITH_AS(json::parse("/a", nullptr, true, true), "[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid comment; expecting '/' or '*' after '/'; last read: '/a'", json::parse_error);
CHECK_THROWS_WITH_AS(json::parse("/*", nullptr, true, true), "[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value - invalid comment; missing closing '*/'; last read: '/*<U+0000>'", json::parse_error);
}
}