You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let file = File::open("resources/test-file-lf").unwrap();
36
36
letmut reader = EasyReader::new(file).unwrap();
37
37
38
-
reader.from_eof();
38
+
reader.eof();
39
39
assert!(reader.prev_line().unwrap().unwrap().eq("EEEE EEEEE EEEE EEEEE"),"[test-file-lf] The first line from the EOF should be: EEEE EEEEE EEEE EEEEE");
40
40
assert!(reader.prev_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-lf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
41
41
assert!(reader.prev_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-lf] The third line from the EOF should be: CCCC CCCCC");
42
42
assert!(reader.current_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-lf] The third line from the EOF should be: CCCC CCCCC");
43
43
assert!(reader.next_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-lf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
44
44
45
-
reader.from_bof();
45
+
reader.bof();
46
46
assert!(reader.next_line().unwrap().unwrap().eq("AAAA AAAA"),"[test-file-lf] The first line from the BOF should be: AAAA AAAA");
47
47
assert!(reader.next_line().unwrap().unwrap().eq("B B BB BBB"),"[test-file-lf] The second line from the BOF should be: B B BB BBB");
48
48
assert!(reader.next_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-lf] The third line from the BOF should be: CCCC CCCCC");
let file = File::open("resources/test-file-crlf").unwrap();
53
53
letmut reader = EasyReader::new(file).unwrap();
54
54
55
-
reader.from_eof();
55
+
reader.eof();
56
56
assert!(reader.prev_line().unwrap().unwrap().eq("EEEE EEEEE EEEE EEEEE"),"[test-file-crlf] The first line from the EOF should be: EEEE EEEEE EEEE EEEEE");
57
57
assert!(reader.prev_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-crlf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
58
58
assert!(reader.prev_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-crlf] The third line from the EOF should be: CCCC CCCCC");
59
59
assert!(reader.current_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-crlf] The third line from the EOF should be: CCCC CCCCC");
60
60
assert!(reader.next_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-crlf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
61
61
62
-
reader.from_bof();
62
+
reader.bof();
63
63
assert!(reader.next_line().unwrap().unwrap().eq("AAAA AAAA"),"[test-file-crlf] The first line from the BOF should be: AAAA AAAA");
64
64
assert!(reader.next_line().unwrap().unwrap().eq("B B BB BBB"),"[test-file-crlf] The second line from the BOF should be: B B BB BBB");
65
65
assert!(reader.next_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-crlf] The third line from the BOF should be: CCCC CCCCC");
@@ -98,7 +98,7 @@ fn test_iterations() {
98
98
assert!(reader.current_line().unwrap().unwrap().eq("EEEE EEEEE EEEE EEEEE"),"The first line from the EOF should be: EEEE EEEEE EEEE EEEEE");
99
99
assert!(reader.prev_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
100
100
101
-
reader.from_eof();
101
+
reader.eof();
102
102
whileletOk(Some(line)) = reader.prev_line(){
103
103
assert!(!line.is_empty(),"Empty line, but test-file-lf does not contain empty lines");
104
104
}
@@ -113,14 +113,14 @@ fn test_indexed() {
113
113
letmut reader = EasyReader::new(file).unwrap();
114
114
reader.build_index().unwrap();
115
115
116
-
reader.from_eof();
116
+
reader.eof();
117
117
assert!(reader.prev_line().unwrap().unwrap().eq("EEEE EEEEE EEEE EEEEE"),"[test-file-lf] The first line from the EOF should be: EEEE EEEEE EEEE EEEEE");
118
118
assert!(reader.prev_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-lf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
119
119
assert!(reader.prev_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-lf] The third line from the EOF should be: CCCC CCCCC");
120
120
assert!(reader.current_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-lf] The third line from the EOF should be: CCCC CCCCC");
121
121
assert!(reader.next_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-lf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
122
122
123
-
reader.from_bof();
123
+
reader.bof();
124
124
assert!(reader.next_line().unwrap().unwrap().eq("AAAA AAAA"),"[test-file-lf] The first line from the BOF should be: AAAA AAAA");
125
125
assert!(reader.next_line().unwrap().unwrap().eq("B B BB BBB"),"[test-file-lf] The second line from the BOF should be: B B BB BBB");
126
126
assert!(reader.next_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-lf] The third line from the BOF should be: CCCC CCCCC");
@@ -131,14 +131,14 @@ fn test_indexed() {
131
131
letmut reader = EasyReader::new(file).unwrap();
132
132
reader.build_index().unwrap();
133
133
134
-
reader.from_eof();
134
+
reader.eof();
135
135
assert!(reader.prev_line().unwrap().unwrap().eq("EEEE EEEEE EEEE EEEEE"),"[test-file-crlf] The first line from the EOF should be: EEEE EEEEE EEEE EEEEE");
136
136
assert!(reader.prev_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-crlf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
137
137
assert!(reader.prev_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-crlf] The third line from the EOF should be: CCCC CCCCC");
138
138
assert!(reader.current_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-crlf] The third line from the EOF should be: CCCC CCCCC");
139
139
assert!(reader.next_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"[test-file-crlf] The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
140
140
141
-
reader.from_bof();
141
+
reader.bof();
142
142
assert!(reader.next_line().unwrap().unwrap().eq("AAAA AAAA"),"[test-file-crlf] The first line from the BOF should be: AAAA AAAA");
143
143
assert!(reader.next_line().unwrap().unwrap().eq("B B BB BBB"),"[test-file-crlf] The second line from the BOF should be: B B BB BBB");
144
144
assert!(reader.next_line().unwrap().unwrap().eq("CCCC CCCCC"),"[test-file-crlf] The third line from the BOF should be: CCCC CCCCC");
@@ -156,7 +156,7 @@ fn test_indexed() {
156
156
assert!(reader.current_line().unwrap().unwrap().eq("EEEE EEEEE EEEE EEEEE"),"The first line from the EOF should be: EEEE EEEEE EEEE EEEEE");
157
157
assert!(reader.prev_line().unwrap().unwrap().eq("DDDD DDDDD DD DDD DDD DD"),"The second line from the EOF should be: DDDD DDDDD DD DDD DDD DD");
158
158
159
-
reader.from_eof();
159
+
reader.eof();
160
160
whileletOk(Some(line)) = reader.prev_line(){
161
161
assert!(!line.is_empty(),"Empty line, but test-file-lf does not contain empty lines");
0 commit comments