1
1
mirror of https://github.com/walles/moar.git synced 2024-11-29 17:23:37 +03:00
moar/sample-files
Johan Walles b781d09a72 Add another test case
diff --git m/reader_test.go m/reader_test.go
index 176192b..bed1e33 100644
--- m/reader_test.go
+++ m/reader_test.go
@@ -30,6 +30,12 @@ func _TestGetLineCount(t *testing.T, reader *Reader) {
 	if err != nil {
 		t.Error("Error counting lines of", *reader.name, err)
 	}
+
+	if strings.HasSuffix(*reader.name, "/line-without-newline.txt") {
+		// "wc -l" thinks this file contains zero lines
+		fileLineCount = 1
+	}
+
 	if reader.GetLineCount() != fileLineCount {
 		t.Errorf("Got %d lines but expected %d: <%s>",
 			reader.GetLineCount(), fileLineCount, *reader.name)
diff --git sample-files/line-without-newline.txt sample-files/line-without-newline.txt
new file mode 100644
index 0000000..2260c57
--- /dev/null
+++ sample-files/line-without-newline.txt
@@ -0,0 +1 @@
+This file contains no newlines
\ No newline at end of file

Change-Id: Ic2801ce3477a7afd4537d340385c884c5f2b7438
2019-11-19 14:47:44 +01:00
..
8-bit-color.txt Add sample file for color handling 2019-10-28 21:54:57 +01:00
compressed.txt.bz2 Add (failing) compressed-files tests 2019-06-23 21:30:11 +02:00
compressed.txt.gz Add (failing) compressed-files tests 2019-06-23 21:30:11 +02:00
compressed.txt.xz Add (failing) compressed-files tests 2019-06-23 21:30:11 +02:00
dos.txt Reboot in Go 2019-06-08 22:12:52 +02:00
empty Dodge corner case issue 2019-07-15 18:49:25 +02:00
gitdiff-color.txt Reboot in Go 2019-06-08 22:12:52 +02:00
hej.txt Reboot in Go 2019-06-08 22:12:52 +02:00
large-git-log-patch.txt Reboot in Go 2019-06-08 22:12:52 +02:00
line-without-newline.txt Add another test case 2019-11-19 14:47:44 +01:00
long-and-wide.txt Reboot in Go 2019-06-08 22:12:52 +02:00
long.txt Reboot in Go 2019-06-08 22:12:52 +02:00
man-page-overstrike.txt Reboot in Go 2019-06-08 22:12:52 +02:00
no-ending-newline.txt Reboot in Go 2019-06-08 22:12:52 +02:00
short.txt Reboot in Go 2019-06-08 22:12:52 +02:00
test.log Reboot in Go 2019-06-08 22:12:52 +02:00
two-lines.txt Reboot in Go 2019-06-08 22:12:52 +02:00
utf8.txt Reboot in Go 2019-06-08 22:12:52 +02:00
with-tabs.c Reboot in Go 2019-06-08 22:12:52 +02:00