MCPcopy Index your code
hub / github.com/endbasic/endbasic / check_file

Function check_file

std/src/storage/fs.rs:147–155  ·  view source on GitHub ↗

Reads `path` and checks that its contents match `exp_lines`.

(path: &Path, exp_lines: &[&str])

Source from the content-addressed store, hash-verified

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]) {

Callers 1

test_directorydrive_putFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by 1

test_directorydrive_putFunction · 0.68