Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UI example code in contributor guide #13864

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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