diff --git a/test/test_parser.cpp b/test/test_parser.cpp index e3f8147..6243d1b 100644 --- a/test/test_parser.cpp +++ b/test/test_parser.cpp @@ -1344,14 +1344,21 @@ std::vector generate_csv_data(const std::vector& data, void write_to_file(const std::vector& data, const std::string& delim, const std::string& file_name) { std::ofstream out{file_name, std::ios_base::app}; + std::string line; for (size_t i = 0; i < data.size(); ++i) { - out << data[i]; + line += data[i]; 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 @@ -1526,8 +1533,8 @@ void test_combinations(const std::vector& input_data, std::string, std::string>(); if (i < n) { check_error(); - //std::cout << s0 << ' ' << s1 << ' ' << s2 << ' ' << s3 - // << ' ' << s4 << std::endl; + // std::cout << s0 << ' ' << s1 << ' ' << s2 << ' ' << s3 + // << ' ' << s4 << std::endl; CHECK(s0 == expected_data[i][layout[0]].value); CHECK(s1 == expected_data[i][layout[1]].value); CHECK(s2 == expected_data[i][layout[2]].value);