mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 13:05:20 +01:00
update test names
This commit is contained in:
parent
b847699b5e
commit
c094ede588
@ -9,7 +9,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// TODO rule of 5-3-1
|
||||
namespace ss {
|
||||
|
||||
template <typename... Matchers>
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <algorithm>
|
||||
#include <ss/converter.hpp>
|
||||
|
||||
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<int>("");
|
||||
@ -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<ss::ax<int, 0>>("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<ss::nx<int, 1>>("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<ss::ir<int, 0, 2>>("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<ss::oor<int, 1, 5>>("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<ss::ne<std::string>>("");
|
||||
@ -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<ss::lt<int, 3>>("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<int>("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::escape<'\\'>, ss::trim<' '>, ss::quote<'"'>> c;
|
||||
c.set_error_mode(ss::error_mode::error_string);
|
||||
|
||||
|
@ -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<bool, std::string>{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<char, std::string>{'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::optional<int>, 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<type>(var));
|
||||
|
||||
TEST_CASE("testing extract functions for std::variant") {
|
||||
TEST_CASE("extract test functions for std::variant") {
|
||||
{
|
||||
std::string s = "22";
|
||||
{
|
||||
|
@ -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<X> 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<X> 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<X> data = {{1, 2, "x\\\nx\\\nx"}, {3, 4, "y\\\ny\\\ny"},
|
||||
{5, 6, "z\\\nz"}, {7, 8, "u"},
|
||||
|
@ -174,7 +174,7 @@ void test_combinations(matches_type& matches, std::vector<std::string> 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<ss::quote<'"'>> 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::quote<'"'>, ss::trim<' '>, ss::escape<'\\'>> c;
|
||||
auto& s = c.splitter;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user