From c71f042f88ca0176858b0decb2ce1701e12f2b02 Mon Sep 17 00:00:00 2001 From: Sebastian Ziebell Date: Mon, 6 May 2024 14:03:47 +0200 Subject: [PATCH] Update example code in contributor guide This updates the UI example case code. The previous code snippet did not compile successfully anymore. --- src/doc/contrib/src/tests/writing.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/doc/contrib/src/tests/writing.md b/src/doc/contrib/src/tests/writing.md index 9c56b783d53..6072ee83818 100644 --- a/src/doc/contrib/src/tests/writing.md +++ b/src/doc/contrib/src/tests/writing.md @@ -207,14 +207,15 @@ mod ; `tests/testsuite///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; @@ -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); } ```