From 37f1fb534fff0c239bd2fff707f5faaf6927dd08 Mon Sep 17 00:00:00 2001 From: ado Date: Sat, 29 Jul 2023 22:51:32 +0200 Subject: [PATCH] WIP, Continue writing additional parser tests --- test/test_parser2.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test_parser2.cpp b/test/test_parser2.cpp index 67bd8e3..3b1ff6f 100644 --- a/test/test_parser2.cpp +++ b/test/test_parser2.cpp @@ -136,7 +136,11 @@ std::vector generate_csv_data(const std::vector& data, constexpr static auto escape = '\\'; constexpr static auto quote = '"'; constexpr static auto space = ' '; +#ifdef _WIN32 + constexpr static auto new_line = "\r\n"; +#else constexpr static auto new_line = '\n'; +#endif constexpr static auto helper0 = '#'; constexpr static auto helper1 = '$'; // constexpr static auto helper3 = '&'; @@ -274,13 +278,15 @@ void write_to_file(const std::vector& data, #define CHECK_EQ_DBG(V1, V2) \ if (V1 != V2) { \ + CHECK(V1 == V2); \ auto tmp1 = V1; \ + replace_all2(tmp1, "\r\n", "(-)"); \ replace_all2(tmp1, "\n", "(_)"); \ auto tmp2 = V2; \ + replace_all2(tmp2, "\r\n", "(-)"); \ replace_all2(tmp2, "\n", "(_)"); \ std::cout << "<" << tmp1 << ">" << std::endl; \ std::cout << "<" << tmp2 << ">" << std::endl; \ - CHECK(V1 == V2); \ } template