diff --git a/include/ss/parser.hpp b/include/ss/parser.hpp index c6783f3..9f2d78d 100644 --- a/include/ss/parser.hpp +++ b/include/ss/parser.hpp @@ -9,7 +9,6 @@ #include #include -// TODO rule of 5-3-1 namespace ss { template diff --git a/test/test_converter.cpp b/test/test_converter.cpp index e8eec52..c33c25b 100644 --- a/test/test_converter.cpp +++ b/test/test_converter.cpp @@ -2,7 +2,7 @@ #include #include -TEST_CASE("testing split") { +TEST_CASE("converter test split") { ss::converter c; for (const auto& [s, expected, delim] : // clang-format off @@ -22,7 +22,7 @@ TEST_CASE("testing split") { } } -TEST_CASE("testing valid conversions") { +TEST_CASE("converter test valid conversions") { ss::converter c; { @@ -109,7 +109,7 @@ TEST_CASE("testing valid conversions") { } } -TEST_CASE("testing invalid conversions") { +TEST_CASE("converter test invalid conversions") { ss::converter c; c.convert(""); @@ -143,7 +143,7 @@ TEST_CASE("testing invalid conversions") { REQUIRE(!c.valid()); } -TEST_CASE("testing ss:ax restriction (all except)") { +TEST_CASE("converter test ss:ax restriction (all except)") { ss::converter c; c.convert>("0"); @@ -174,7 +174,7 @@ TEST_CASE("testing ss:ax restriction (all except)") { } } -TEST_CASE("testing ss:nx restriction (none except)") { +TEST_CASE("converter test ss:nx restriction (none except)") { ss::converter c; c.convert>("3"); @@ -208,7 +208,7 @@ TEST_CASE("testing ss:nx restriction (none except)") { } } -TEST_CASE("testing ss:ir restriction (in range)") { +TEST_CASE("converter test ss:ir restriction (in range)") { ss::converter c; c.convert>("3"); @@ -242,7 +242,7 @@ TEST_CASE("testing ss:ir restriction (in range)") { } } -TEST_CASE("testing ss:oor restriction (out of range)") { +TEST_CASE("converter test ss:oor restriction (out of range)") { ss::converter c; c.convert>("3"); @@ -289,7 +289,7 @@ inline bool ss::extract(const char* begin, const char* end, return true; } -TEST_CASE("testing ss:ne restriction (not empty)") { +TEST_CASE("converter test ss:ne restriction (not empty)") { ss::converter c; c.convert>(""); @@ -324,7 +324,8 @@ TEST_CASE("testing ss:ne restriction (not empty)") { } } -TEST_CASE("testing ss:lt ss::lte ss::gt ss::gte restriction (in range)") { +TEST_CASE( + "converter test ss:lt ss::lte ss::gt ss::gte restriction (in range)") { ss::converter c; c.convert>("3"); @@ -382,7 +383,7 @@ TEST_CASE("testing ss:lt ss::lte ss::gt ss::gte restriction (in range)") { } } -TEST_CASE("testing error mode") { +TEST_CASE("converter test error mode") { ss::converter c; c.convert("junk"); @@ -395,7 +396,7 @@ TEST_CASE("testing error mode") { CHECK(!c.error_msg().empty()); } -TEST_CASE("testing converter with quotes spacing and escaping") { +TEST_CASE("converter test converter with quotes spacing and escaping") { { ss::converter c; @@ -442,7 +443,7 @@ TEST_CASE("testing converter with quotes spacing and escaping") { } } -TEST_CASE("testing invalid split conversions") { +TEST_CASE("converter test invalid split conversions") { ss::converter, ss::trim<' '>, ss::quote<'"'>> c; c.set_error_mode(ss::error_mode::error_string); diff --git a/test/test_extractions.cpp b/test/test_extractions.cpp index 244b368..118a1a7 100644 --- a/test/test_extractions.cpp +++ b/test/test_extractions.cpp @@ -59,7 +59,7 @@ using ul = unsigned long; using ll = long long; using ull = unsigned long long; -TEST_CASE("testing extract functions for decimal values") { +TEST_CASE("extract test functions for decimal values") { CHECK_DECIMAL_CONVERSION(1234, short); CHECK_DECIMAL_CONVERSION(1234, us); CHECK_DECIMAL_CONVERSION(1234, int); @@ -77,7 +77,7 @@ TEST_CASE("testing extract functions for decimal values") { CHECK(!t.has_value()); \ } -TEST_CASE("testing extract functions for numbers with invalid inputs") { +TEST_CASE("extract test functions for numbers with invalid inputs") { // negative unsigned value CHECK_INVALID_CONVERSION("-1234", ul); @@ -125,7 +125,7 @@ TEST_CASE("testing extract functions for numbers with invalid inputs") { CHECK(!t.has_value()); \ } -TEST_CASE("testing extract functions for numbers with out of range inputs") { +TEST_CASE("extract test functions for numbers with out of range inputs") { CHECK_OUT_OF_RANGE_CONVERSION(short); CHECK_OUT_OF_RANGE_CONVERSION(us); CHECK_OUT_OF_RANGE_CONVERSION(int); @@ -136,7 +136,7 @@ TEST_CASE("testing extract functions for numbers with out of range inputs") { CHECK_OUT_OF_RANGE_CONVERSION(ull); } -TEST_CASE("testing extract functions for boolean values") { +TEST_CASE("extract test functions for boolean values") { for (const auto& [b, s] : {std::pair{true, "1"}, {false, "0"}, {true, "true"}, @@ -152,7 +152,7 @@ TEST_CASE("testing extract functions for boolean values") { } } -TEST_CASE("testing extract functions for char values") { +TEST_CASE("extract test functions for char values") { for (const auto& [c, s] : {std::pair{'a', "a"}, {'x', "x"}, {' ', " "}}) { char v; @@ -166,7 +166,7 @@ TEST_CASE("testing extract functions for char values") { } } -TEST_CASE("testing extract functions for std::optional") { +TEST_CASE("extract test functions for std::optional") { for (const auto& [i, s] : {std::pair, std::string>{1, "1"}, {69, "69"}, @@ -209,7 +209,7 @@ TEST_CASE("testing extract functions for std::optional") { #define CHECK_NOT_VARIANT(var, type) CHECK(!std::holds_alternative(var)); -TEST_CASE("testing extract functions for std::variant") { +TEST_CASE("extract test functions for std::variant") { { std::string s = "22"; { diff --git a/test/test_parser.cpp b/test/test_parser.cpp index ad1b844..5b040e6 100644 --- a/test/test_parser.cpp +++ b/test/test_parser.cpp @@ -49,7 +49,7 @@ static void make_and_write(const std::string& file_name, } } -TEST_CASE("testing parser") { +TEST_CASE("parser test various cases") { unique_file_name f; std::vector data = {{1, 2, "x"}, {3, 4, "y"}, {5, 6, "z"}, {7, 8, "u"}, {9, 10, "v"}, {11, 12, "w"}}; @@ -179,7 +179,7 @@ void expect_test_struct(const test_struct&) { } // various scenarios -TEST_CASE("testing composite conversion") { +TEST_CASE("parser test composite conversion") { unique_file_name f; { std::ofstream out{f.name}; @@ -436,7 +436,7 @@ struct xyz { } }; -TEST_CASE("testing the moving of parsed values") { +TEST_CASE("parser test the moving of parsed values") { size_t move_called_one_col; { @@ -482,7 +482,7 @@ TEST_CASE("testing the moving of parsed values") { } } -TEST_CASE("testing the moving of parsed composite values") { +TEST_CASE("parser test the moving of parsed composite values") { // to compile is enough return; ss::parser p{"", ""}; @@ -495,7 +495,7 @@ TEST_CASE("testing the moving of parsed composite values") { [](auto&, auto&, auto&) {}); } -TEST_CASE("testing error mode") { +TEST_CASE("parser test error mode") { unique_file_name f; { std::ofstream out{f.name}; @@ -525,7 +525,7 @@ std::string no_quote(const std::string& s) { return s; } -TEST_CASE("testing csv on multiple lines with quotes") { +TEST_CASE("parser test csv on multiple lines with quotes") { unique_file_name f; std::vector data = {{1, 2, "\"x\nx\nx\""}, {3, 4, "\"y\ny\ny\""}, {5, 6, "\"z\nz\""}, {7, 8, "\"u\"\"\""}, @@ -555,7 +555,7 @@ std::string no_escape(std::string& s) { return s; } -TEST_CASE("testing csv on multiple lines with escapes") { +TEST_CASE("parser test csv on multiple lines with escapes") { unique_file_name f; std::vector data = {{1, 2, "x\\\nx\\\nx"}, {3, 4, "y\\\ny\\\ny"}, {5, 6, "z\\\nz"}, {7, 8, "u"}, diff --git a/test/test_splitter.cpp b/test/test_splitter.cpp index 50ea6af..8054461 100644 --- a/test/test_splitter.cpp +++ b/test/test_splitter.cpp @@ -174,7 +174,7 @@ void test_combinations(matches_type& matches, std::vector delims) { } } -TEST_CASE("testing splitter no setup") { +TEST_CASE("splitter test with no setup") { { matches_type p{{{"x"}, "x"}, {{"\""}, "\""}, {{""}, ""}, {{"\n"}, "\n"}, @@ -184,7 +184,7 @@ TEST_CASE("testing splitter no setup") { } } -TEST_CASE("testing splitter quote") { +TEST_CASE("splitter test with quote") { case_type case1 = {R"("""")"}; case_type case2 = {R"("x""x")", R"(x"x)"}; case_type case3 = {R"("")", R"()"}; @@ -228,7 +228,7 @@ TEST_CASE("testing splitter quote") { } } -TEST_CASE("testing splitter trim") { +TEST_CASE("splitter test with trim") { auto guard = set_combinations_size(3); case_type case1 = spaced({R"(x)"}, " "); case_type case2 = spaced({R"(yy)"}, " "); @@ -258,7 +258,7 @@ TEST_CASE("testing splitter trim") { } } -TEST_CASE("testing splitter escape") { +TEST_CASE("splitter test with escape") { case_type case1 = {R"(x)", R"(\x)"}; case_type case2 = {R"(xx)", R"(\xx)", R"(x\x)", R"(\x\x)"}; case_type case3 = {R"(\\)"}; @@ -295,7 +295,7 @@ TEST_CASE("testing splitter escape") { } } -TEST_CASE("testing splitter quote and trim") { +TEST_CASE("splitter test with quote and trim") { auto guard = set_combinations_size(3); case_type case1 = spaced({R"("""")"}, " "); case_type case2 = spaced({R"("x""x")", R"(x"x)"}, " "); @@ -328,7 +328,7 @@ TEST_CASE("testing splitter quote and trim") { } } -TEST_CASE("testing splitter quote and escape") { +TEST_CASE("splitter test with quote and escape") { case_type case1 = {R"("\"")", R"(\")", R"("""")"}; case_type case2 = {R"("x\"x")", R"(x\"x)", R"(x"x)", R"("x""x")"}; case_type case3 = {R"("")", R"()"}; @@ -376,7 +376,7 @@ TEST_CASE("testing splitter quote and escape") { } } -TEST_CASE("testing splitter escape and trim") { +TEST_CASE("splitter test with escape and trim") { case_type case0 = spaced({R"(\ x\ )", R"(\ \x\ )"}, " "); case_type case1 = spaced({R"(x)", R"(\x)"}, " "); case_type case3 = spaced({R"(\\)"}, " "); @@ -413,7 +413,7 @@ TEST_CASE("testing splitter escape and trim") { } } -TEST_CASE("testing splitter quote and escape and trim") { +TEST_CASE("splitter test with quote and escape and trim") { auto guard = set_combinations_size(3); case_type case1 = spaced({R"("\"")", R"(\")", R"("""")"}, " "); case_type case2 = @@ -466,7 +466,7 @@ TEST_CASE("testing splitter quote and escape and trim") { } } -TEST_CASE("testing splitter constnes if quoting and escaping are disabled") { +TEST_CASE("splitter test constnes if quoting and escaping are disabled") { // to compile is enough return; const char* const line{}; @@ -476,7 +476,7 @@ TEST_CASE("testing splitter constnes if quoting and escaping are disabled") { s2.split(line); } -TEST_CASE("testing error mode") { +TEST_CASE("splitter test error mode") { { // empty delimiter @@ -529,7 +529,7 @@ public: }; } /* ss */ -TEST_CASE("testing unterminated quote") { +TEST_CASE("splitter test unterminated quote") { { ss::converter> c; auto& s = c.splitter; @@ -690,7 +690,7 @@ TEST_CASE("testing unterminated quote") { } } -TEST_CASE("testing invalid splits") { +TEST_CASE("splitter test invalid splits") { ss::converter, ss::trim<' '>, ss::escape<'\\'>> c; auto& s = c.splitter;