From 367e50799e27a373f244a8d89a989577194ff7a0 Mon Sep 17 00:00:00 2001 From: Olga Khlopkova Date: Thu, 18 Jun 2020 13:32:18 +0300 Subject: [PATCH] Unit test for quoted empty string. Co-authored-by: ldo2 --- tests/unit_tests.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit_tests.cpp b/tests/unit_tests.cpp index 12d3ee5..283c0a7 100644 --- a/tests/unit_tests.cpp +++ b/tests/unit_tests.cpp @@ -166,6 +166,15 @@ TEST_CASE("Wrapped quotation marks") REQUIRE_EQ(res.size(), 1); CHECK_EQ(res[0], R"(Contains "quotes", commas and text)"); } + +TEST_CASE("Read quoted empty values") +{ + const auto res = CsvParser::split_record(",\"\""); + REQUIRE_EQ(res.size(), 2); + CHECK_EQ(res[0], ""); + CHECK_EQ(res[1], ""); +} + TEST_SUITE_END(); TEST_SUITE_BEGIN("Read & write");