Skip to content

Commit

Permalink
Update example code in contributor guide
Browse files Browse the repository at this point in the history
This updates the UI example case code. The previous code snippet did not
compile successfully anymore.
  • Loading branch information
justahero committed May 6, 2024
1 parent f489938 commit c71f042
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/doc/contrib/src/tests/writing.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,15 @@ mod <case>;

`tests/testsuite/<command>/<case>/mod.rs`:
```rust,ignore
use cargo_test_support::prelude::*;
use cargo_test_support::compare::assert_ui;
use cargo_test_support::current_dir;
use cargo_test_support::file;
use cargo_test_support::prelude::*;
use cargo_test_support::Project;
use cargo_test_support::curr_dir;
#[cargo_test]
fn case() {
let project = Project::from_template(curr_dir!().join("in"));
let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;
Expand All @@ -224,10 +225,10 @@ fn case() {
.current_dir(cwd)
.assert()
.success()
.stdout_matches_path(curr_dir!().join("stdout.log"))
.stderr_matches_path(curr_dir!().join("stderr.log"));
.stdout_matches(file!("stdout.log"))
.stderr_matches(file!("stderr.log"));
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
}
```

Expand Down

0 comments on commit c71f042

Please sign in to comment.