From f965c4c35ba7a9383d911fe44cbbdbb0c30c5367 Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 14 Feb 2016 22:56:51 +0100 Subject: [PATCH] improved code coverage --- test/unit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/unit.cpp b/test/unit.cpp index fc77fe28..443a2abd 100644 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -12020,6 +12020,12 @@ TEST_CASE("Unicode", "[hide]") json j; CHECK_NOTHROW(j << f); } + + SECTION("error for incomplete/wrong BOM") + { + CHECK_THROWS_AS(json::parse("\xef\xbb"), std::invalid_argument); + CHECK_THROWS_AS(json::parse("\xef\xbb\xbb"), std::invalid_argument); + } } TEST_CASE("regression tests")