• Home
  • Raw
  • Download

Lines Matching refs:assert_eq

13     assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 0);  in test_automatic_rollover()
14 assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); in test_automatic_rollover()
15 assert_eq!(buf.as_slice(), b""); in test_automatic_rollover()
18 assert_eq!(t.write(b"abcde").unwrap(), 5); in test_automatic_rollover()
21 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_automatic_rollover()
22 assert_eq!(t.read_to_end(&mut buf).unwrap(), 5); in test_automatic_rollover()
23 assert_eq!(buf.as_slice(), b"abcde"); in test_automatic_rollover()
25 assert_eq!(t.write(b"fghijklmno").unwrap(), 10); in test_automatic_rollover()
27 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 15); in test_automatic_rollover()
34 assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); in test_explicit_rollover()
35 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); in test_explicit_rollover()
41 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); in test_explicit_rollover()
44 assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); in test_explicit_rollover()
45 assert_eq!(buf.as_slice(), b""); in test_explicit_rollover()
48 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_explicit_rollover()
49 assert_eq!(t.read_to_end(&mut buf).unwrap(), 26); in test_explicit_rollover()
50 assert_eq!(buf.as_slice(), b"abcdefghijklmnopqrstuvwxyz"); in test_explicit_rollover()
51 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); in test_explicit_rollover()
57 assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); in test_seek()
59 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() in test_seek()
60 assert_eq!(t.seek(SeekFrom::Current(-1)).unwrap(), 25); in test_seek()
61 assert_eq!(t.seek(SeekFrom::Current(1)).unwrap(), 26); in test_seek()
62 assert_eq!(t.seek(SeekFrom::Current(1)).unwrap(), 27); in test_seek()
63 assert_eq!(t.seek(SeekFrom::Current(-27)).unwrap(), 0); in test_seek()
67 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_seek()
68 assert_eq!(t.seek(SeekFrom::Start(1)).unwrap(), 1); in test_seek()
69 assert_eq!(t.seek(SeekFrom::Start(26)).unwrap(), 26); in test_seek()
70 assert_eq!(t.seek(SeekFrom::Start(27)).unwrap(), 27); in test_seek()
75 assert_eq!(t.seek(SeekFrom::End(0)).unwrap(), 26); in test_seek()
76 assert_eq!(t.seek(SeekFrom::End(-1)).unwrap(), 25); in test_seek()
77 assert_eq!(t.seek(SeekFrom::End(-26)).unwrap(), 0); in test_seek()
80 assert_eq!(t.seek(SeekFrom::End(1)).unwrap(), 27); in test_seek()
81 assert_eq!(t.seek(SeekFrom::End(1)).unwrap(), 27); in test_seek()
97 assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); in test_seek_read()
102 assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); in test_seek_read()
103 assert_eq!(buf.as_slice(), b""); in test_seek_read()
107 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_seek_read()
108 assert_eq!(t.read_to_end(&mut buf).unwrap(), 26); in test_seek_read()
109 assert_eq!(buf.as_slice(), b"abcdefghijklmnopqrstuvwxyz"); in test_seek_read()
113 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() in test_seek_read()
114 assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); in test_seek_read()
115 assert_eq!(buf.as_slice(), b""); in test_seek_read()
119 assert_eq!(t.seek(SeekFrom::Start(5)).unwrap(), 5); in test_seek_read()
122 assert_eq!(buf, *b"fghij"); in test_seek_read()
125 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 10); // tell() in test_seek_read()
127 assert_eq!(buf, *b"klmno"); in test_seek_read()
131 assert_eq!(t.read(&mut buf).unwrap(), 11); in test_seek_read()
132 assert_eq!(buf[0..11], *b"pqrstuvwxyz"); in test_seek_read()
151 assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); in test_overwrite_middle()
153 assert_eq!(t.seek(SeekFrom::Start(10)).unwrap(), 10); in test_overwrite_middle()
154 assert_eq!(t.write(b"0123456789").unwrap(), 10); in test_overwrite_middle()
155 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_overwrite_middle()
158 assert_eq!(t.read_to_end(&mut buf).unwrap(), 26); in test_overwrite_middle()
159 assert_eq!(buf.as_slice(), b"abcdefghij0123456789uvwxyz"); in test_overwrite_middle()
177 assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); in test_overwrite_and_extend_buffer()
178 assert_eq!(t.seek(SeekFrom::End(-5)).unwrap(), 21); in test_overwrite_and_extend_buffer()
179 assert_eq!(t.write(b"0123456789").unwrap(), 10); in test_overwrite_and_extend_buffer()
180 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_overwrite_and_extend_buffer()
182 assert_eq!(t.read_to_end(&mut buf).unwrap(), 31); in test_overwrite_and_extend_buffer()
183 assert_eq!(buf.as_slice(), b"abcdefghijklmnopqrstu0123456789"); in test_overwrite_and_extend_buffer()
190 assert_eq!(t.write(b"abcdefghijklmno").unwrap(), 15); in test_overwrite_and_extend_rollover()
192 assert_eq!(t.seek(SeekFrom::End(-5)).unwrap(), 10); in test_overwrite_and_extend_rollover()
193 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 10); // tell() in test_overwrite_and_extend_rollover()
195 assert_eq!(t.write(b"0123456789)!@#$%^&*(").unwrap(), 20); in test_overwrite_and_extend_rollover()
197 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 30); // tell() in test_overwrite_and_extend_rollover()
199 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_overwrite_and_extend_rollover()
200 assert_eq!(t.read_to_end(&mut buf).unwrap(), 30); in test_overwrite_and_extend_rollover()
201 assert_eq!(buf.as_slice(), b"abcdefghij0123456789)!@#$%^&*("); in test_overwrite_and_extend_rollover()
205 assert_eq!(t.write(b"abcde").unwrap(), 5); in test_sparse()
206 assert_eq!(t.seek(SeekFrom::Current(5)).unwrap(), 10); in test_sparse()
207 assert_eq!(t.write(b"klmno").unwrap(), 5); in test_sparse()
208 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_sparse()
210 assert_eq!(t.read_to_end(&mut buf).unwrap(), 15); in test_sparse()
211 assert_eq!(buf.as_slice(), b"abcde\0\0\0\0\0klmno"); in test_sparse()
229 assert_eq!(t.write(b"abcde").unwrap(), 5); in test_sparse_write_rollover()
231 assert_eq!(t.seek(SeekFrom::Current(5)).unwrap(), 10); in test_sparse_write_rollover()
233 assert_eq!(t.write(b"klmno").unwrap(), 5); in test_sparse_write_rollover()
235 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_sparse_write_rollover()
237 assert_eq!(t.read_to_end(&mut buf).unwrap(), 15); in test_sparse_write_rollover()
238 assert_eq!(buf.as_slice(), b"abcde\0\0\0\0\0klmno"); in test_sparse_write_rollover()
244 assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); in test_set_len()
250 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() in test_set_len()
252 assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); in test_set_len()
253 assert_eq!(buf.as_slice(), b""); in test_set_len()
254 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() in test_set_len()
258 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_set_len()
259 assert_eq!(t.read_to_end(&mut buf).unwrap(), 10); in test_set_len()
260 assert_eq!(buf.as_slice(), b"abcdefghij"); in test_set_len()
265 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 10); // tell() in test_set_len()
266 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_set_len()
267 assert_eq!(t.read_to_end(&mut buf).unwrap(), 40); in test_set_len()
268 assert_eq!( in test_set_len()
291 assert_eq!(t.write(b"abcde").unwrap(), 5); in test_set_len_rollover()
293 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 5); // tell() in test_set_len_rollover()
295 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_set_len_rollover()
296 assert_eq!(t.read_to_end(&mut buf).unwrap(), 5); in test_set_len_rollover()
297 assert_eq!(buf.as_slice(), b"abcde"); in test_set_len_rollover()
298 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 5); // tell() in test_set_len_rollover()
303 assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 5); // tell() in test_set_len_rollover()
304 assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); in test_set_len_rollover()
305 assert_eq!(t.read_to_end(&mut buf).unwrap(), 20); in test_set_len_rollover()
306 assert_eq!(buf.as_slice(), b"abcde\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); in test_set_len_rollover()