add splitter tests

This commit is contained in:
ado
2021-01-23 21:39:18 +01:00
parent 15f0c63643
commit 24fe96dc44
6 changed files with 403 additions and 77 deletions

View File

@@ -1,26 +1,7 @@
#include "test_helpers.hpp"
#include <algorithm>
#include <ss/converter.hpp>
#ifdef CMAKE_GITHUB_CI
#include <doctest/doctest.h>
#else
#include <doctest.h>
#endif
class buffer {
constexpr static auto buff_size = 1024;
char data_[buff_size];
public:
char* operator()(const char* data) {
memset(data_, '\0', buff_size);
strcpy(data_, data);
return data_;
}
};
static buffer buff;
TEST_CASE("testing split") {
ss::converter c;
for (const auto& [s, expected, delim] :