mirror of
https://github.com/red0124/ssp.git
synced 2025-02-02 16:51:12 +01:00
WIP, Continue writing additional parser tests
This commit is contained in:
parent
560bf815dc
commit
f28f000035
@ -1344,14 +1344,21 @@ std::vector<std::string> generate_csv_data(const std::vector<field>& data,
|
|||||||
void write_to_file(const std::vector<std::string>& data,
|
void write_to_file(const std::vector<std::string>& data,
|
||||||
const std::string& delim, const std::string& file_name) {
|
const std::string& delim, const std::string& file_name) {
|
||||||
std::ofstream out{file_name, std::ios_base::app};
|
std::ofstream out{file_name, std::ios_base::app};
|
||||||
|
std::string line;
|
||||||
for (size_t i = 0; i < data.size(); ++i) {
|
for (size_t i = 0; i < data.size(); ++i) {
|
||||||
out << data[i];
|
line += data[i];
|
||||||
if (i != data.size() - 1) {
|
if (i != data.size() - 1) {
|
||||||
out << delim;
|
line += delim;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out << std::endl;
|
|
||||||
out.close();
|
#ifdef _WIN32
|
||||||
|
line += "\n";
|
||||||
|
#else
|
||||||
|
line += "\r\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
out << line;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
@ -1526,8 +1533,8 @@ void test_combinations(const std::vector<column>& input_data,
|
|||||||
std::string, std::string>();
|
std::string, std::string>();
|
||||||
if (i < n) {
|
if (i < n) {
|
||||||
check_error();
|
check_error();
|
||||||
//std::cout << s0 << ' ' << s1 << ' ' << s2 << ' ' << s3
|
// std::cout << s0 << ' ' << s1 << ' ' << s2 << ' ' << s3
|
||||||
// << ' ' << s4 << std::endl;
|
// << ' ' << s4 << std::endl;
|
||||||
CHECK(s0 == expected_data[i][layout[0]].value);
|
CHECK(s0 == expected_data[i][layout[0]].value);
|
||||||
CHECK(s1 == expected_data[i][layout[1]].value);
|
CHECK(s1 == expected_data[i][layout[1]].value);
|
||||||
CHECK(s2 == expected_data[i][layout[2]].value);
|
CHECK(s2 == expected_data[i][layout[2]].value);
|
||||||
|
Loading…
Reference in New Issue
Block a user