From 51ac6000d2b1b55c0cf1032677261ed407d72230 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 21 Jan 2021 13:36:23 +0100 Subject: [PATCH] :white_check_mark: improve coverage --- test/src/unit-diagnostics.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/src/unit-diagnostics.cpp b/test/src/unit-diagnostics.cpp index a75f3e972..8bd5c41fa 100644 --- a/test/src/unit-diagnostics.cpp +++ b/test/src/unit-diagnostics.cpp @@ -90,4 +90,9 @@ TEST_CASE("Better diagnostics") std::string s; CHECK_THROWS_WITH_AS(s = j["a/b"]["m~n"].get(), "[json.exception.type_error.302] (/a~1b/m~0n) type must be string, but is number", json::type_error); } + + SECTION("Parse error") + { + CHECK_THROWS_WITH_AS(json::parse(""), "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error); + } }