()
| 117 | |
| 118 | #[test] |
| 119 | fn read_exact_at() { |
| 120 | let dir = tempfile::tempdir().unwrap(); |
| 121 | let file = check!(OpenOptions::new() |
| 122 | .create_new(true) |
| 123 | .read(true) |
| 124 | .write(true) |
| 125 | .open(dir.path().join("file"))); |
| 126 | check!(write!(&file, "abcdefghijklmnopqrstuvwxyz")); |
| 127 | let mut buf0 = vec![0; 8]; |
| 128 | let mut buf1 = vec![0; 8]; |
| 129 | check!(file.read_exact_at(&mut buf0, 4)); |
| 130 | check!(file.read_exact_at(&mut buf1, 12)); |
| 131 | assert_eq!(check!(file.stream_position()), 26); |
| 132 | assert_eq!(&buf0, b"efghijkl"); |
| 133 | assert_eq!(&buf1, b"mnopqrst"); |
| 134 | } |
| 135 | |
| 136 | /// Like `read_exact_at`, but with an unexpected EOF error. |
| 137 | #[test] |
no outgoing calls
no test coverage detected