You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/doc/contrib/src/tests/writing.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,16 @@ test.
64
64
- See [`support::compare`] for an explanation of the string pattern matching.
65
65
Patterns are used to make it easier to match against the expected output.
66
66
67
+
#### Filesystem layout testing
68
+
69
+
Tests often to need to verify Cargo created/removed files.
70
+
The `CargoPathExt` trait (implemented by `Path` and `PathBuf`) provides a `assert_file_layout()` to verify the files in a directory (including nested directories).
71
+
This takes a snapshot of (unordered) file paths for the given directory and asserts that all files are present and no new files have been created.
72
+
73
+
Files vary across operating systems, for example `.pdb` files on Windows.
74
+
Some of these platform specific files are ignored from snapshotting by default.
75
+
You can use `assert_file_layout_with_ignored_paths()` to change the file patterns that are ignored.
76
+
67
77
#### Testing Nightly Features
68
78
69
79
If you are testing a Cargo feature that only works on "nightly" Cargo, then
0 commit comments