From 2b37ebb059af859792d41ed7f701f78ef081c34c Mon Sep 17 00:00:00 2001 From: Krzysiek Karbowiak Date: Thu, 17 Mar 2022 10:37:32 +0100 Subject: [PATCH] Refactor assertions in unit-convenience.cpp --- test/src/unit-convenience.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/src/unit-convenience.cpp b/test/src/unit-convenience.cpp index e66b42cac..f2018bf3c 100644 --- a/test/src/unit-convenience.cpp +++ b/test/src/unit-convenience.cpp @@ -106,12 +106,8 @@ TEST_CASE("convenience functions") check_escaped("\x1f", "\\u001f"); // invalid UTF-8 characters - CHECK_THROWS_AS(check_escaped("ä\xA9ü"), json::type_error&); - CHECK_THROWS_WITH(check_escaped("ä\xA9ü"), - "[json.exception.type_error.316] invalid UTF-8 byte at index 2: 0xA9"); + CHECK_THROWS_WITH_AS(check_escaped("ä\xA9ü"), "[json.exception.type_error.316] invalid UTF-8 byte at index 2: 0xA9", json::type_error&); - CHECK_THROWS_AS(check_escaped("\xC2"), json::type_error&); - CHECK_THROWS_WITH(check_escaped("\xC2"), - "[json.exception.type_error.316] incomplete UTF-8 string; last byte: 0xC2"); + CHECK_THROWS_WITH_AS(check_escaped("\xC2"), "[json.exception.type_error.316] incomplete UTF-8 string; last byte: 0xC2", json::type_error&); } }