add ignore_header setup option, add unit tests for parsing by header, add string_view to possible conversion values

This commit is contained in:
ado
2022-03-27 21:04:02 +02:00
parent 45d166f93d
commit a8fa5c753c
69 changed files with 4194 additions and 33 deletions

View File

@@ -167,6 +167,12 @@ using get_multiline_t = typename get_multiline<Ts...>::type;
class string_error;
////////////////
// ignore_header
////////////////
class ignore_header;
////////////////
// setup implementation
////////////////
@@ -185,13 +191,19 @@ private:
template <typename T>
struct is_string_error : std::is_same<T, string_error> {};
template <typename T>
struct is_ignore_header : std::is_same<T, ignore_header> {};
constexpr static auto count_matcher = count_v<is_matcher, Ts...>;
constexpr static auto count_multiline =
count_v<is_instance_of_multiline, Ts...>;
constexpr static auto count_string_error = count_v<is_string_error, Ts...>;
constexpr static auto count_ignore_header =
count_v<is_ignore_header, Ts...>;
constexpr static auto number_of_valid_setup_types =
count_matcher + count_multiline + count_string_error;
count_matcher + count_multiline + count_string_error +
count_ignore_header;
using trim_left_only = get_matcher_t<trim_left, Ts...>;
using trim_right_only = get_matcher_t<trim_right, Ts...>;
@@ -206,6 +218,7 @@ public:
using multiline = get_multiline_t<Ts...>;
constexpr static bool string_error = (count_string_error == 1);
constexpr static bool ignore_header = (count_ignore_header == 1);
private:
#define ASSERT_MSG "cannot have the same match character in multiple matchers"