diff --git a/tests/src/unit-conversions.cpp b/tests/src/unit-conversions.cpp index 298dcdc55..6c36a2451 100644 --- a/tests/src/unit-conversions.cpp +++ b/tests/src/unit-conversions.cpp @@ -1779,10 +1779,10 @@ TEST_CASE("std::optional") // operator); there is no SFINAE path that distinguishes "call from inside // std::optional's constructor" from "direct call". Use get>() // or get_to() instead for correct null handling. See #4864 and #5246. - CHECK_THROWS_AS_WITH(std::optional(j_null), json::type_error, - "type must be string, but is null"); - CHECK_THROWS_AS_WITH(std::optional(j_null), json::type_error, - "type must be number, but is null"); + CHECK_THROWS_WITH_AS(std::optional(j_null), + "[json.exception.type_error.302] type must be string, but is null", json::type_error&); + CHECK_THROWS_WITH_AS(std::optional(j_null), + "[json.exception.type_error.302] type must be number, but is null", json::type_error&); } SECTION("string")