mirror of
https://github.com/red0124/ssp.git
synced 2025-12-14 21:59:55 +01:00
Update get_line_buffer, update new version of get_line_file to work with data that has no new line at eof
This commit is contained in:
@@ -571,9 +571,22 @@ template <bool buffer_mode>
|
||||
void test_no_new_line_at_eof() {
|
||||
test_no_new_line_at_eof_impl<buffer_mode>({});
|
||||
test_no_new_line_at_eof_impl<buffer_mode>({{1, 2, "X"}});
|
||||
test_no_new_line_at_eof_impl<buffer_mode>({{1, 2, "X"}, {}});
|
||||
test_no_new_line_at_eof_impl<buffer_mode>({{1, 2, "X"}, {3, 4, "YY"}});
|
||||
test_no_new_line_at_eof_impl<buffer_mode>({{1, 2, "X"}, {3, 4, "YY"}, {}});
|
||||
test_no_new_line_at_eof_impl<buffer_mode>(
|
||||
{{1, 2, "X"}, {3, 4, "YY"}, {5, 6, "ZZZ"}, {7, 8, "UUU"}});
|
||||
|
||||
for (size_t i = 0; i < 2 * ss::get_line_initial_buffer_size; ++i) {
|
||||
test_no_new_line_at_eof_impl<buffer_mode>(
|
||||
{{1, 2, std::string(i, 'X')}});
|
||||
|
||||
for (size_t j = 0; j < 2 * ss::get_line_initial_buffer_size; ++j) {
|
||||
|
||||
test_no_new_line_at_eof_impl<buffer_mode>(
|
||||
{{1, 2, std::string(i, 'X')}, {3, 4, std::string(j, 'Y')}});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("test no new line at end of data") {
|
||||
|
||||
Reference in New Issue
Block a user