From 13efc7a02ab0cc23a28528510ba692b65eac18dc Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 9 Jan 2015 20:24:58 +0100 Subject: [PATCH] More tests to get line coverage backt o 100% --- test/json_unit.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/json_unit.cc b/test/json_unit.cc index 3835e198..b2fcd65e 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); }