From f444d9c14f761faf86a0189991ddcb598a206ef7 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 5 Sep 2021 09:25:58 +0200 Subject: [PATCH] :white_check_mark: improve coverage --- test/src/unit-bon8.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/src/unit-bon8.cpp b/test/src/unit-bon8.cpp index 6dd1f610f..4d8d2546a 100644 --- a/test/src/unit-bon8.cpp +++ b/test/src/unit-bon8.cpp @@ -596,6 +596,17 @@ TEST_CASE("BON8") CHECK(result == expected); } } + + SECTION("object without count") + { + SECTION("{\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4, \"five\": 5}") + { + json j = R"({"one": 1, "two": 2, "three": 3, "four": 4, "five": 5})"_json; + std::vector expected = {0x8b, 'f', 'i', 'v', 'e', 0x95, 'f', 'o', 'u', 'r', 0x94, 'o', 'n', 'e', 0x91, 't', 'h', 'r', 'e', 'e', 0x93, 't', 'w', 'o', 0x92, 0xFE}; + const auto result = json::to_bon8(j); + CHECK(result == expected); + } + } } } }