diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fe07582..207be65 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -32,8 +32,9 @@ set(DOCTEST "${FETCHCONTENT_BASE_DIR}/doctest-src") enable_testing() -foreach(name IN ITEMS test_splitter test_parser test_parser2 test_converter - test_extractions) +foreach(name IN ITEMS test_splitter test_parser test_converter tesst_extractions + test_parser2_segment1 test_parser2_segment2 + test_parser2_segment3 test_parser2_segment4) add_executable("${name}" "${name}.cpp") target_link_libraries("${name}" PRIVATE ssp::ssp fast_float doctest::doctest) diff --git a/test/meson.build b/test/meson.build index 9e6ec07..fb88527 100644 --- a/test/meson.build +++ b/test/meson.build @@ -3,7 +3,10 @@ test_sources = files([ 'test_splitter.cpp', 'test_converter.cpp', 'test_parser.cpp', - 'test_parser2.cpp', + 'test_parser2_segment1.cpp', + 'test_parser2_segment2.cpp', + 'test_parser2_segment3.cpp', + 'test_parser2_segment4.cpp', 'test_extractions.cpp', 'test_extractions_without_fast_float.cpp', ]) diff --git a/test/test_helpers.hpp b/test/test_helpers.hpp index 07ded4a..b7f362f 100644 --- a/test/test_helpers.hpp +++ b/test/test_helpers.hpp @@ -1,9 +1,10 @@ #pragma once -#include -#include -#include #include #include +#include +#include +#include +#include #ifdef CMAKE_GITHUB_CI #include @@ -48,13 +49,12 @@ struct unique_file_name { const std::string name; unique_file_name(const std::string& test) - : name{"random_" + test + "_" + std::to_string(i++) + "_" + time_now_rand() + - "_file.csv"} { + : name{"random_" + test + "_" + std::to_string(i++) + "_" + + time_now_rand() + "_file.csv"} { } ~unique_file_name() { - // TODO uncomment - // std::filesystem::remove(name); + std::filesystem::remove(name); } }; diff --git a/test/test_parser2.cpp b/test/test_parser2.hpp similarity index 99% rename from test/test_parser2.cpp rename to test/test_parser2.hpp index a10d1ac..ef58585 100644 --- a/test/test_parser2.cpp +++ b/test/test_parser2.hpp @@ -612,7 +612,9 @@ void test_option_combinations3() { } /* namespace */ -TEST_CASE("parser test various cases version 2") { +#if 0 + +TEST_CASE("parser test various cases version 2 segment 1") { using quote = ss::quote<'"'>; using escape = ss::escape<'\\'>; using multiline = ss::multiline; @@ -622,18 +624,27 @@ TEST_CASE("parser test various cases version 2") { using trimr = ss::trim_right<' '>; using triml = ss::trim_left<' '>; + // segment 1 test_option_combinations3<>(); test_option_combinations3(); test_option_combinations3(); + + // segment 2 test_option_combinations3(); test_option_combinations3(); test_option_combinations3(); + + // segment 3 test_option_combinations3(); test_option_combinations3(); + // segment 4 test_option_combinations(); test_option_combinations(); #else test_option_combinations3(); #endif } + +#endif + diff --git a/test/test_parser2_segment1.cpp b/test/test_parser2_segment1.cpp new file mode 100644 index 0000000..435d1f1 --- /dev/null +++ b/test/test_parser2_segment1.cpp @@ -0,0 +1,13 @@ +#include "test_parser2.hpp" + +TEST_CASE("parser test various cases version 2 segment 1") { +#ifdef CMAKE_GITHUB_CI + using quote = ss::quote<'"'>; + using escape = ss::escape<'\\'>; + + test_option_combinations3<>(); + test_option_combinations3(); + test_option_combinations3(); +#endif +} + diff --git a/test/test_parser2_segment2.cpp b/test/test_parser2_segment2.cpp new file mode 100644 index 0000000..70ffccd --- /dev/null +++ b/test/test_parser2_segment2.cpp @@ -0,0 +1,14 @@ +#include "test_parser2.hpp" + +TEST_CASE("parser test various cases version 2 segment 2") { +#ifdef CMAKE_GITHUB_CI + using quote = ss::quote<'"'>; + using escape = ss::escape<'\\'>; + using multiline = ss::multiline; + + test_option_combinations3(); + test_option_combinations3(); + test_option_combinations3(); +#endif +} + diff --git a/test/test_parser2_segment3.cpp b/test/test_parser2_segment3.cpp new file mode 100644 index 0000000..7818cdc --- /dev/null +++ b/test/test_parser2_segment3.cpp @@ -0,0 +1,14 @@ +#include "test_parser2.hpp" + +TEST_CASE("parser test various cases version 2 segment 3") { +#ifdef CMAKE_GITHUB_CI + using quote = ss::quote<'"'>; + using escape = ss::escape<'\\'>; + using multiline = ss::multiline; + using multiline_r = ss::multiline_restricted<10>; + + test_option_combinations3(); + test_option_combinations3(); +#endif +} + diff --git a/test/test_parser2_segment4.cpp b/test/test_parser2_segment4.cpp new file mode 100644 index 0000000..e8caad5 --- /dev/null +++ b/test/test_parser2_segment4.cpp @@ -0,0 +1,18 @@ +#include "test_parser2.hpp" + +TEST_CASE("parser test various cases version 2 segment 4") { + using quote = ss::quote<'"'>; + using escape = ss::escape<'\\'>; + using multiline = ss::multiline; + +#ifdef CMAKE_GITHUB_CI + using trimr = ss::trim_right<' '>; + using triml = ss::trim_left<' '>; + + test_option_combinations(); + test_option_combinations(); +#else + test_option_combinations3(); +#endif +} +