From 8ede0cd712d748ad40a93b057d84d84e2dd165b6 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Mon, 9 May 2022 22:33:50 -0400 Subject: [PATCH] add coverage --- tests/src/unit-bjdata.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/src/unit-bjdata.cpp b/tests/src/unit-bjdata.cpp index 2e280ffd6..6ebc62996 100644 --- a/tests/src/unit-bjdata.cpp +++ b/tests/src/unit-bjdata.cpp @@ -2094,6 +2094,20 @@ TEST_CASE("BJData") CHECK(!json::sax_parse(v, &scp, json::input_format_t::bjdata)); } + SECTION("key() in ndarray _ArrayType_") + { + std::vector v = {'[', '$', 'U', '#', '[', '$', 'U', '#', 'i', 2, 2, 2, 1, 2, 3, 4}; + SaxCountdown scp(9); + CHECK(!json::sax_parse(v, &scp, json::input_format_t::bjdata)); + } + + SECTION("key() in ndarray _ArrayType_") + { + std::vector v = {'[', '$', 'U', '#', '[', '$', 'U', '#', 'i', 2, 2, 2, 1, 2, 3, 4}; + SaxCountdown scp(10); + CHECK(!json::sax_parse(v, &scp, json::input_format_t::bjdata)); + } + SECTION("string() in ndarray _ArrayType_") { std::vector v = {'[', '$', 'U', '#', '[', '$', 'i', '#', 'i', 2, 3, 2, 6, 5, 4, 3, 2, 1};