From 6ddb115072f99fb148ca77a63fde5bc5786268a7 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 12 Apr 2015 18:12:29 +0200 Subject: [PATCH] more coverage --- test/unit.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unit.cpp b/test/unit.cpp index 58f5af7c..66d5de23 100644 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -7344,6 +7344,13 @@ TEST_CASE("parser class") // horizontal tab CHECK(json::parser("\"\\t\"").parse() == json("\t")); + // exotic test cases for full coverage + { + std::stringstream ss; + ss << "\"\\u000\n1\""; + CHECK(json::parser(ss).parse().get() == "\x01"); + } + CHECK(json::parser("\"\\u0001\"").parse().get() == "\x01"); CHECK(json::parser("\"\\u000a\"").parse().get() == "\n"); CHECK(json::parser("\"\\u00b0\"").parse().get() == "°");