detect the exception in testcase - SECTION("null")

This commit is contained in:
chenguoping 2020-06-24 15:18:13 +08:00
parent 4c4af3b161
commit e0f6c96c19

View File

@ -1710,7 +1710,8 @@ TEST_CASE("std::optional")
std::optional<std::string> opt_null;
CHECK(json(opt_null) == j_null);
CHECK(std::optional<std::string>(j_null) == std::nullopt);
CHECK_THROWS_WITH(std::optional<std::string>(j_null) == std::nullopt,
"[json.exception.type_error.302] type must be string, but is null");
}
SECTION("string")