Skip to content

Commit c71f042

Browse files
committed
Update example code in contributor guide
This updates the UI example case code. The previous code snippet did not compile successfully anymore.
1 parent f489938 commit c71f042

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/doc/contrib/src/tests/writing.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,15 @@ mod <case>;
207207

208208
`tests/testsuite/<command>/<case>/mod.rs`:
209209
```rust,ignore
210-
use cargo_test_support::prelude::*;
211210
use cargo_test_support::compare::assert_ui;
211+
use cargo_test_support::current_dir;
212+
use cargo_test_support::file;
213+
use cargo_test_support::prelude::*;
212214
use cargo_test_support::Project;
213-
use cargo_test_support::curr_dir;
214215
215216
#[cargo_test]
216217
fn case() {
217-
let project = Project::from_template(curr_dir!().join("in"));
218+
let project = Project::from_template(current_dir!().join("in"));
218219
let project_root = project.root();
219220
let cwd = &project_root;
220221
@@ -224,10 +225,10 @@ fn case() {
224225
.current_dir(cwd)
225226
.assert()
226227
.success()
227-
.stdout_matches_path(curr_dir!().join("stdout.log"))
228-
.stderr_matches_path(curr_dir!().join("stderr.log"));
228+
.stdout_matches(file!("stdout.log"))
229+
.stderr_matches(file!("stderr.log"));
229230
230-
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
231+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
231232
}
232233
```
233234

0 commit comments

Comments
 (0)