From 6c8e860fb52d06a8731331622b32d512dcc9cc06 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 7 Dec 2016 22:20:41 -0500 Subject: [PATCH] Test that files consisting of just 1 or 2 newline characters are written correctly --- test/files/one_eol.txt | 1 + test/files/two_eol.txt | 2 ++ test/src/test_Buffer.cc | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 test/files/one_eol.txt create mode 100644 test/files/two_eol.txt diff --git a/test/files/one_eol.txt b/test/files/one_eol.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test/files/one_eol.txt @@ -0,0 +1 @@ + diff --git a/test/files/two_eol.txt b/test/files/two_eol.txt new file mode 100644 index 0000000..139597f --- /dev/null +++ b/test/files/two_eol.txt @@ -0,0 +1,2 @@ + + diff --git a/test/src/test_Buffer.cc b/test/src/test_Buffer.cc index 61c81e7..372f460 100644 --- a/test/src/test_Buffer.cc +++ b/test/src/test_Buffer.cc @@ -7,6 +7,8 @@ TEST(BufferTest, writes_an_identical_file_to_what_is_loaded_if_no_changes_were_p { const char * files_to_test[] = { "test/files/empty.txt", + "test/files/one_eol.txt", + "test/files/two_eol.txt", "test/files/line_endings/cr_format.txt", "test/files/line_endings/crlf_format.txt", "test/files/line_endings/lf_format.txt",