Reads `path` and checks that its contents match `exp_lines`.
(path: &Path, exp_lines: &[&str])
| 145 | |
| 146 | /// Reads `path` and checks that its contents match `exp_lines`. |
| 147 | fn check_file(path: &Path, exp_lines: &[&str]) { |
| 148 | let file = File::open(path).unwrap(); |
| 149 | let reader = io::BufReader::new(file); |
| 150 | let mut lines = vec![]; |
| 151 | for line in reader.lines() { |
| 152 | lines.push(line.unwrap()); |
| 153 | } |
| 154 | assert_eq!(exp_lines, lines.as_slice()); |
| 155 | } |
| 156 | |
| 157 | /// Creates `path` with the contents in `lines` and with a deterministic modification time. |
| 158 | fn write_file(path: &Path, lines: &[&str]) { |