MCPcopy Index your code
hub / github.com/assert-rs/assert_fs / code_example

Function code_example

tests/assert.rs:5–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4#[test]
5fn code_example() {
6 let temp = assert_fs::TempDir::new().unwrap();
7 let input_file = temp.child("foo.txt");
8 input_file.touch().unwrap();
9
10 // ... do something with input_file ...
11
12 input_file.assert("");
13 temp.child("bar.txt").assert(predicate::path::missing());
14
15 temp.close().unwrap();
16}
17
18#[test]
19#[should_panic = "Unexpected file"]

Callers

nothing calls this directly

Calls 4

childMethod · 0.80
touchMethod · 0.80
assertMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected