From 851315c878923c8c21483f5472d3632de0fb242f Mon Sep 17 00:00:00 2001 From: jprochazk Date: Sun, 19 Jul 2020 18:35:58 +0200 Subject: [PATCH] add regression test --- test/src/unit-regression.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index 7415f68a..b33c39ec 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -1954,6 +1954,16 @@ TEST_CASE("regression tests") auto val = j.value("x", defval); auto val2 = j.value("y", defval); } + + SECTION("issue #2293 - eof doesnt cause parsing to stop") + { + std::vector data = + { + 0x7B, 0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x4F, 0x42 + }; + json result = json::from_cbor(data, true, false); + CHECK(result.is_discarded()); + } } #if !defined(JSON_NOEXCEPTION)