From ba45fe1839aaff16d5687c4f9a1ec9bb33f4ec5c Mon Sep 17 00:00:00 2001 From: ado Date: Sat, 29 Jul 2023 22:57:33 +0200 Subject: [PATCH] WIP, Continue writing additional parser tests --- test/test_parser2.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test_parser2.cpp b/test/test_parser2.cpp index 3b1ff6f..98f0429 100644 --- a/test/test_parser2.cpp +++ b/test/test_parser2.cpp @@ -139,12 +139,14 @@ std::vector generate_csv_data(const std::vector& data, #ifdef _WIN32 constexpr static auto new_line = "\r\n"; #else - constexpr static auto new_line = '\n'; + constexpr static auto new_line = "\n"; #endif constexpr static auto helper0 = '#'; constexpr static auto helper1 = '$'; // constexpr static auto helper3 = '&'; + auto escape_s = std::string{escape}; + std::vector output; if (setup::escape::enabled && setup::quote::enabled) { @@ -162,7 +164,7 @@ std::vector generate_csv_data(const std::vector& data, rng.rand_insert_n(value, escape, 2); if (!quote_newline) { replace_all2(value, {new_line}, {helper1}); - replace_all2(value, {helper1}, {escape, new_line}); + replace_all2(value, {helper1}, {escape_s + new_line}); } replace_all2(value, {escape, escape}, {escape}); replace_all2(value, {escape, helper0}, {helper0}); @@ -201,7 +203,7 @@ std::vector generate_csv_data(const std::vector& data, replace_all2(value, {escape}, {helper0}); rng.rand_insert_n(value, escape, 3); replace_all2(value, {new_line}, {helper1}); - replace_all2(value, {helper1}, {escape, new_line}); + replace_all2(value, {helper1}, {escape_s + new_line}); replace_all2(value, {escape, escape}, {escape}); replace_all2(value, {escape, helper0}, {helper0});