Commit 1e896eb9 authored by Niels's avatar Niels

improved code coverage

parent 94331a35
......@@ -445,6 +445,10 @@ TEST_CASE("parser class")
CHECK_THROWS_AS(json::parser("\"\\u0\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u01\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u012\"").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u0").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u01").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("\"\\u012").parse(), std::invalid_argument);
CHECK_THROWS_WITH(json::parser("\"").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\\"").parse(),
......@@ -457,6 +461,14 @@ TEST_CASE("parser class")
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u012\"").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u0").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u01").parse(),
"parse error - unexpected '\"'");
CHECK_THROWS_WITH(json::parser("\"\\u012").parse(),
"parse error - unexpected '\"'");
// invalid escapes
for (int c = 1; c < 128; ++c)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment