diff --git a/test/json_unit.cc b/test/json_unit.cc index 3835e198f..b2fcd65e3 100644 --- a/test/json_unit.cc +++ b/test/json_unit.cc @@ -1652,6 +1652,11 @@ TEST_CASE("Parser") CHECK(json::parse("\"a\\nz\"") == json("a\nz")); CHECK(json::parse("\"\\n\"") == json("\n")); + // escaping senseless stuff + CHECK_THROWS_AS(json::parse("\"\\z\""), std::invalid_argument); + CHECK_THROWS_AS(json::parse("\"\\ \""), std::invalid_argument); + CHECK_THROWS_AS(json::parse("\"\\9\""), std::invalid_argument); + // quotes must be closed CHECK_THROWS_AS(json::parse("\""), std::invalid_argument); }