From e0f6c96c194c97ff9eb749979216c2d4da173067 Mon Sep 17 00:00:00 2001 From: chenguoping Date: Wed, 24 Jun 2020 15:18:13 +0800 Subject: [PATCH] detect the exception in testcase - SECTION("null") --- test/src/unit-conversions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index d966da4c9..476a2149d 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -1710,7 +1710,8 @@ TEST_CASE("std::optional") std::optional opt_null; CHECK(json(opt_null) == j_null); - CHECK(std::optional(j_null) == std::nullopt); + CHECK_THROWS_WITH(std::optional(j_null) == std::nullopt, + "[json.exception.type_error.302] type must be string, but is null"); } SECTION("string")