diff --git a/README.md b/README.md index cf870973..fb793ab2 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Example: include(FetchContent) FetchContent_Declare(json - GIT_REPOSITORY https://github.com/nlohmann/json + GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v3.7.3) FetchContent_GetProperties(json) diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index 373344d8..8803ac90 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -1890,6 +1890,28 @@ TEST_CASE("regression tests") json j = val; } + SECTION("issue #1715 - json::from_cbor does not respect allow_exceptions = false when input is string literal") + { + SECTION("string literal") + { + json cbor = json::from_cbor("B", true, false); + CHECK(cbor.is_discarded()); + } + + SECTION("string array") + { + const char input[] = { 'B', 0x00 }; + json cbor = json::from_cbor(input, true, false); + CHECK(cbor.is_discarded()); + } + + SECTION("std::string") + { + json cbor = json::from_cbor(std::string("B"), true, false); + CHECK(cbor.is_discarded()); + } + } + SECTION("issue #1805 - A pair is json constructible only if T1 and T2 are json constructible") { static_assert(!std::is_constructible>::value, "");