From 5ed5f3687ba5d77c18c3247c348c2dbfff5ecda9 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Sat, 23 Oct 2021 18:50:53 +0200 Subject: [PATCH] Improve test coverage --- extras/tests/JsonDeserializer/string.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extras/tests/JsonDeserializer/string.cpp b/extras/tests/JsonDeserializer/string.cpp index 5ab87640..7b5b7c01 100644 --- a/extras/tests/JsonDeserializer/string.cpp +++ b/extras/tests/JsonDeserializer/string.cpp @@ -97,12 +97,19 @@ TEST_CASE("Not enough room to save the key") { DynamicJsonDocument doc(JSON_OBJECT_SIZE(1) + 8); SECTION("Quoted string") { + REQUIRE(deserializeJson(doc, "{\"example\":1}") == + DeserializationError::Ok); REQUIRE(deserializeJson(doc, "{\"accuracy\":1}") == DeserializationError::NoMemory); + REQUIRE(deserializeJson(doc, "{\"hello\":1,\"world\"}") == + DeserializationError::NoMemory); // fails in the second string } SECTION("Non-quoted string") { + REQUIRE(deserializeJson(doc, "{example:1}") == DeserializationError::Ok); REQUIRE(deserializeJson(doc, "{accuracy:1}") == DeserializationError::NoMemory); + REQUIRE(deserializeJson(doc, "{hello:1,world}") == + DeserializationError::NoMemory); // fails in the second string } }