From 65107f7c9d61e60a1e26bbbeec59a82954dcc559 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 17 Jan 2021 13:32:36 +0100 Subject: [PATCH] :green_heart: fix build --- test/src/unit-diagnostics.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/src/unit-diagnostics.cpp b/test/src/unit-diagnostics.cpp index d7c8e772b..bdae90226 100644 --- a/test/src/unit-diagnostics.cpp +++ b/test/src/unit-diagnostics.cpp @@ -29,7 +29,12 @@ SOFTWARE. #include "doctest_compatibility.h" +#ifdef JSON_DIAGNOSTICS + #undef JSON_DIAGNOSTICS +#endif + #define JSON_DIAGNOSTICS 1 + #include using nlohmann::json; @@ -40,7 +45,7 @@ TEST_CASE("Better diagnostics") json j; j["a"]["b"]["c"] = 1; std::string s; - CHECK_THROWS_WITH_AS(s = j["a"]["b"]["c"], "[json.exception.type_error.302] (/a/b/c) type must be string, but is number", json::type_error); + CHECK_THROWS_WITH_AS(s = j["a"]["b"]["c"].get(), "[json.exception.type_error.302] (/a/b/c) type must be string, but is number", json::type_error); } SECTION("missing key")