diff --git a/Cargo.lock b/Cargo.lock index 72b958c26..80fdf1a89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3132,9 +3132,9 @@ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snapbox" -version = "0.4.16" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73145a30df4935f50a7b13c1882bce7d194d7071ad0bcc36e7cacbf9ef16e3ec" +checksum = "8269b717f21b142c0377f1e617e80999e3ef6b1c010959b44fd93320722d2cba" dependencies = [ "anstream", "anstyle", @@ -3151,9 +3151,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ccde059aad940984ff696fe8c280900f7ea71a6fb45fce65071a3f2c40b667" +checksum = "e1c4b838b05d15ab22754068cb73500b2f3b07bf09d310e15b27f88160f1de40" dependencies = [ "anstream", ] diff --git a/Cargo.toml b/Cargo.toml index 0d4ea2dfd..63b99dbc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,7 +91,7 @@ sha1 = "0.10.6" sha2 = "0.10.8" shell-escape = "0.1.5" supports-hyperlinks = "2.1.0" -snapbox = { version = "0.4.16", features = ["diff", "path"] } +snapbox = { version = "0.5.0", features = ["diff", "path"] } tar = { version = "0.4.40", default-features = false } tempfile = "3.9.0" thiserror = "1.0.56" diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs index cbf793f0d..184f79916 100644 --- a/crates/cargo-test-support/src/lib.rs +++ b/crates/cargo-test-support/src/lib.rs @@ -35,25 +35,8 @@ macro_rules! t { }; } -#[macro_export] -macro_rules! curr_dir { - () => { - $crate::_curr_dir(std::path::Path::new(file!())); - }; -} - -#[doc(hidden)] -pub fn _curr_dir(mut file_path: &'static Path) -> &'static Path { - if !file_path.exists() { - // HACK: Must be running in the rust-lang/rust workspace, adjust the paths accordingly. - let prefix = PathBuf::from("src").join("tools").join("cargo"); - if let Ok(crate_relative) = file_path.strip_prefix(prefix) { - file_path = crate_relative - } - } - assert!(file_path.exists(), "{} does not exist", file_path.display()); - file_path.parent().unwrap() -} +pub use snapbox::file; +pub use snapbox::path::current_dir; #[track_caller] pub fn panic_error(what: &str, err: impl Into) -> ! { diff --git a/crates/mdman/tests/compare.rs b/crates/mdman/tests/compare.rs index fde2c235d..661afcd95 100644 --- a/crates/mdman/tests/compare.rs +++ b/crates/mdman/tests/compare.rs @@ -17,12 +17,12 @@ fn run(name: &str) { for &format in &[Format::Man, Format::Md, Format::Text] { let section = mdman::extract_section(&input).unwrap(); let result = mdman::convert(&input, format, url.clone(), map.clone()).unwrap(); - let expected_path = format!( + let expected_path = PathBuf::from(format!( "tests/compare/expected/{}.{}", name, format.extension(section) - ); - snapbox::assert_eq_path(expected_path, result); + )); + snapbox::assert_eq(snapbox::Data::read_from(&expected_path, None), result); } } diff --git a/tests/testsuite/cargo/help/mod.rs b/tests/testsuite/cargo/help/mod.rs index 559377b27..fcf53c959 100644 --- a/tests/testsuite/cargo/help/mod.rs +++ b/tests/testsuite/cargo/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -7,6 +7,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo/z_help/mod.rs b/tests/testsuite/cargo/z_help/mod.rs index cca503d70..43afd3853 100644 --- a/tests/testsuite/cargo/z_help/mod.rs +++ b/tests/testsuite/cargo/z_help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .args(["-Z", "help"]) .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"]); } diff --git a/tests/testsuite/cargo_add/add_basic/mod.rs b/tests/testsuite/cargo_add/add_basic/mod.rs index 67cd948ae..e7bf45e86 100644 --- a/tests/testsuite/cargo_add/add_basic/mod.rs +++ b/tests/testsuite/cargo_add/add_basic/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/add_multiple/mod.rs b/tests/testsuite/cargo_add/add_multiple/mod.rs index ce5e9b71d..ffab903a6 100644 --- a/tests/testsuite/cargo_add/add_multiple/mod.rs +++ b/tests/testsuite/cargo_add/add_multiple/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/add_normalized_name_external/mod.rs b/tests/testsuite/cargo_add/add_normalized_name_external/mod.rs index ced39b99c..c455e9d88 100644 --- a/tests/testsuite/cargo_add/add_normalized_name_external/mod.rs +++ b/tests/testsuite/cargo_add/add_normalized_name_external/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -24,7 +24,7 @@ fn case() { .feature("unstable", &[]) .publish(); - 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; @@ -34,8 +34,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/add_toolchain/mod.rs b/tests/testsuite/cargo_add/add_toolchain/mod.rs index 905b8c8a2..3be555f37 100644 --- a/tests/testsuite/cargo_add/add_toolchain/mod.rs +++ b/tests/testsuite/cargo_add/add_toolchain/mod.rs @@ -1,12 +1,12 @@ 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; @@ -16,8 +16,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/build/mod.rs b/tests/testsuite/cargo_add/build/mod.rs index 001dd3a8f..35ffd5674 100644 --- a/tests/testsuite/cargo_add/build/mod.rs +++ b/tests/testsuite/cargo_add/build/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/build_prefer_existing_version/mod.rs b/tests/testsuite/cargo_add/build_prefer_existing_version/mod.rs index 285ec658a..25462d5ec 100644 --- a/tests/testsuite/cargo_add/build_prefer_existing_version/mod.rs +++ b/tests/testsuite/cargo_add/build_prefer_existing_version/mod.rs @@ -1,4 +1,6 @@ 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; @@ -19,8 +21,7 @@ fn case() { .publish(); } - let project = - Project::from_template("tests/testsuite/cargo_add/build_prefer_existing_version/in"); + let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); let cwd = &project_root; @@ -30,11 +31,8 @@ fn case() { .current_dir(cwd) .assert() .success() - .stdout_matches_path("tests/testsuite/cargo_add/build_prefer_existing_version/stdout.log") - .stderr_matches_path("tests/testsuite/cargo_add/build_prefer_existing_version/stderr.log"); + .stdout_matches(file!["stdout.log"]) + .stderr_matches(file!["stderr.log"]); - assert_ui().subset_matches( - "tests/testsuite/cargo_add/build_prefer_existing_version/out", - &project_root, - ); + assert_ui().subset_matches(current_dir!().join("out"), &project_root); } diff --git a/tests/testsuite/cargo_add/change_rename_target/mod.rs b/tests/testsuite/cargo_add/change_rename_target/mod.rs index d1540c8ad..d6705379a 100644 --- a/tests/testsuite/cargo_add/change_rename_target/mod.rs +++ b/tests/testsuite/cargo_add/change_rename_target/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/cyclic_features/mod.rs b/tests/testsuite/cargo_add/cyclic_features/mod.rs index 8b4c6123a..eeac50de5 100644 --- a/tests/testsuite/cargo_add/cyclic_features/mod.rs +++ b/tests/testsuite/cargo_add/cyclic_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -13,7 +13,7 @@ fn case() { .feature("feature-two", &["feature-one"]) .publish(); - 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; @@ -23,8 +23,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/default_features/mod.rs b/tests/testsuite/cargo_add/default_features/mod.rs index 9d313b9d9..6994260ab 100644 --- a/tests/testsuite/cargo_add/default_features/mod.rs +++ b/tests/testsuite/cargo_add/default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/deprecated_default_features/mod.rs b/tests/testsuite/cargo_add/deprecated_default_features/mod.rs index c4fdd4f3e..6baa89265 100644 --- a/tests/testsuite/cargo_add/deprecated_default_features/mod.rs +++ b/tests/testsuite/cargo_add/deprecated_default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(&cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/deprecated_section/mod.rs b/tests/testsuite/cargo_add/deprecated_section/mod.rs index c4fdd4f3e..6baa89265 100644 --- a/tests/testsuite/cargo_add/deprecated_section/mod.rs +++ b/tests/testsuite/cargo_add/deprecated_section/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(&cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit/mod.rs b/tests/testsuite/cargo_add/detect_workspace_inherit/mod.rs index 2b9550ce0..60b454d32 100644 --- a/tests/testsuite/cargo_add/detect_workspace_inherit/mod.rs +++ b/tests/testsuite/cargo_add/detect_workspace_inherit/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_features/mod.rs b/tests/testsuite/cargo_add/detect_workspace_inherit_features/mod.rs index 8067166dc..9cf13026c 100644 --- a/tests/testsuite/cargo_add/detect_workspace_inherit_features/mod.rs +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_features/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_optional/mod.rs b/tests/testsuite/cargo_add/detect_workspace_inherit_optional/mod.rs index 423f1a26d..faac9b7fa 100644 --- a/tests/testsuite/cargo_add/detect_workspace_inherit_optional/mod.rs +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_optional/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/detect_workspace_inherit_public/mod.rs b/tests/testsuite/cargo_add/detect_workspace_inherit_public/mod.rs index 680d4c4e3..d920ddada 100644 --- a/tests/testsuite/cargo_add/detect_workspace_inherit_public/mod.rs +++ b/tests/testsuite/cargo_add/detect_workspace_inherit_public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/dev/mod.rs b/tests/testsuite/cargo_add/dev/mod.rs index c838f1eac..7e1532a9b 100644 --- a/tests/testsuite/cargo_add/dev/mod.rs +++ b/tests/testsuite/cargo_add/dev/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/dev_build_conflict/mod.rs b/tests/testsuite/cargo_add/dev_build_conflict/mod.rs index 70432b529..f836e3015 100644 --- a/tests/testsuite/cargo_add/dev_build_conflict/mod.rs +++ b/tests/testsuite/cargo_add/dev_build_conflict/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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); } diff --git a/tests/testsuite/cargo_add/dev_prefer_existing_version/mod.rs b/tests/testsuite/cargo_add/dev_prefer_existing_version/mod.rs index 2d3698c14..e7a09805d 100644 --- a/tests/testsuite/cargo_add/dev_prefer_existing_version/mod.rs +++ b/tests/testsuite/cargo_add/dev_prefer_existing_version/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::alt_init(); @@ -21,7 +21,7 @@ fn case() { .publish(); } - 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/dry_run/mod.rs b/tests/testsuite/cargo_add/dry_run/mod.rs index 438ec7b73..8afffdc2a 100644 --- a/tests/testsuite/cargo_add/dry_run/mod.rs +++ b/tests/testsuite/cargo_add/dry_run/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/empty_dep_name/mod.rs b/tests/testsuite/cargo_add/empty_dep_name/mod.rs index d7044ee11..0c7dd0daa 100644 --- a/tests/testsuite/cargo_add/empty_dep_name/mod.rs +++ b/tests/testsuite/cargo_add/empty_dep_name/mod.rs @@ -1,13 +1,13 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -17,8 +17,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/empty_dep_table/mod.rs b/tests/testsuite/cargo_add/empty_dep_table/mod.rs index d612a07f7..f06d47cfb 100644 --- a/tests/testsuite/cargo_add/empty_dep_table/mod.rs +++ b/tests/testsuite/cargo_add/empty_dep_table/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/features/mod.rs b/tests/testsuite/cargo_add/features/mod.rs index aebae9b3b..d3e485a56 100644 --- a/tests/testsuite/cargo_add/features/mod.rs +++ b/tests/testsuite/cargo_add/features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_activated_over_limit/mod.rs b/tests/testsuite/cargo_add/features_activated_over_limit/mod.rs index 467e9a681..689245de3 100644 --- a/tests/testsuite/cargo_add/features_activated_over_limit/mod.rs +++ b/tests/testsuite/cargo_add/features_activated_over_limit/mod.rs @@ -1,10 +1,10 @@ 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 itertools::Itertools; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { const MANY_FEATURES_COUNT: usize = 200; @@ -18,7 +18,7 @@ fn case() { } test_package.publish(); - 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_deactivated_over_limit/mod.rs b/tests/testsuite/cargo_add/features_deactivated_over_limit/mod.rs index b2ed6f87d..287dce667 100644 --- a/tests/testsuite/cargo_add/features_deactivated_over_limit/mod.rs +++ b/tests/testsuite/cargo_add/features_deactivated_over_limit/mod.rs @@ -1,10 +1,10 @@ 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 itertools::Itertools; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { const MANY_FEATURES_COUNT: usize = 200; @@ -18,7 +18,7 @@ fn case() { } test_package.publish(); - 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_empty/mod.rs b/tests/testsuite/cargo_add/features_empty/mod.rs index d58c6a292..a18e1062b 100644 --- a/tests/testsuite/cargo_add/features_empty/mod.rs +++ b/tests/testsuite/cargo_add/features_empty/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_multiple_occurrences/mod.rs b/tests/testsuite/cargo_add/features_multiple_occurrences/mod.rs index 4189be7ea..535944f2c 100644 --- a/tests/testsuite/cargo_add/features_multiple_occurrences/mod.rs +++ b/tests/testsuite/cargo_add/features_multiple_occurrences/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_preserve/mod.rs b/tests/testsuite/cargo_add/features_preserve/mod.rs index 708fb4ddf..d06571d37 100644 --- a/tests/testsuite/cargo_add/features_preserve/mod.rs +++ b/tests/testsuite/cargo_add/features_preserve/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_spaced_values/mod.rs b/tests/testsuite/cargo_add/features_spaced_values/mod.rs index 4ee483110..7b31b535d 100644 --- a/tests/testsuite/cargo_add/features_spaced_values/mod.rs +++ b/tests/testsuite/cargo_add/features_spaced_values/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/features_unknown/mod.rs b/tests/testsuite/cargo_add/features_unknown/mod.rs index 552319402..4f4dbc85a 100644 --- a/tests/testsuite/cargo_add/features_unknown/mod.rs +++ b/tests/testsuite/cargo_add/features_unknown/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/features_unknown_no_features/mod.rs b/tests/testsuite/cargo_add/features_unknown_no_features/mod.rs index dff50a61f..25a62208e 100644 --- a/tests/testsuite/cargo_add/features_unknown_no_features/mod.rs +++ b/tests/testsuite/cargo_add/features_unknown_no_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/git/mod.rs b/tests/testsuite/cargo_add/git/mod.rs index 507fb417d..8a4a6deeb 100644 --- a/tests/testsuite/cargo_add/git/mod.rs +++ b/tests/testsuite/cargo_add/git/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -27,8 +27,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_branch/mod.rs b/tests/testsuite/cargo_add/git_branch/mod.rs index 8235a7c3c..7eb022468 100644 --- a/tests/testsuite/cargo_add/git_branch/mod.rs +++ b/tests/testsuite/cargo_add/git_branch/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let (git_dep, git_repo) = cargo_test_support::git::new_repo("git-package", |project| { @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_conflicts_namever/mod.rs b/tests/testsuite/cargo_add/git_conflicts_namever/mod.rs index 86b268b59..fc71c56a6 100644 --- a/tests/testsuite/cargo_add/git_conflicts_namever/mod.rs +++ b/tests/testsuite/cargo_add/git_conflicts_namever/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -33,8 +33,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/git_dev/mod.rs b/tests/testsuite/cargo_add/git_dev/mod.rs index 96be4f46e..767101c47 100644 --- a/tests/testsuite/cargo_add/git_dev/mod.rs +++ b/tests/testsuite/cargo_add/git_dev/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -27,8 +27,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_inferred_name/mod.rs b/tests/testsuite/cargo_add/git_inferred_name/mod.rs index 4a3ded8c2..430696537 100644 --- a/tests/testsuite/cargo_add/git_inferred_name/mod.rs +++ b/tests/testsuite/cargo_add/git_inferred_name/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -27,8 +27,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_inferred_name_multiple/mod.rs b/tests/testsuite/cargo_add/git_inferred_name_multiple/mod.rs index a915f3472..30254de72 100644 --- a/tests/testsuite/cargo_add/git_inferred_name_multiple/mod.rs +++ b/tests/testsuite/cargo_add/git_inferred_name_multiple/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -67,8 +67,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/git_multiple_names/mod.rs b/tests/testsuite/cargo_add/git_multiple_names/mod.rs index 3ffe10714..61f8cc987 100644 --- a/tests/testsuite/cargo_add/git_multiple_names/mod.rs +++ b/tests/testsuite/cargo_add/git_multiple_names/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -45,8 +45,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs b/tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs index eb76b6f34..fe14f67b5 100644 --- a/tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs +++ b/tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -26,7 +26,7 @@ fn case() { target_feature = [] "#; - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -56,8 +56,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_normalized_name/mod.rs b/tests/testsuite/cargo_add/git_normalized_name/mod.rs index dbad20105..f539f7986 100644 --- a/tests/testsuite/cargo_add/git_normalized_name/mod.rs +++ b/tests/testsuite/cargo_add/git_normalized_name/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -27,8 +27,8 @@ fn case() { .current_dir(cwd) .assert() .failure() // Fuzzy searching for paths isn't supported at this time - .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); } diff --git a/tests/testsuite/cargo_add/git_registry/mod.rs b/tests/testsuite/cargo_add/git_registry/mod.rs index e44d71470..35c0d7b06 100644 --- a/tests/testsuite/cargo_add/git_registry/mod.rs +++ b/tests/testsuite/cargo_add/git_registry/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::alt_init(); @@ -21,7 +21,7 @@ fn case() { .publish(); } - 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; let git_dep = cargo_test_support::git::new("versioned-package", |project| { @@ -46,8 +46,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/git_rev/mod.rs b/tests/testsuite/cargo_add/git_rev/mod.rs index b8a669c7a..ee3800239 100644 --- a/tests/testsuite/cargo_add/git_rev/mod.rs +++ b/tests/testsuite/cargo_add/git_rev/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let (git_dep, git_repo) = cargo_test_support::git::new_repo("git-package", |project| { @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/git_tag/mod.rs b/tests/testsuite/cargo_add/git_tag/mod.rs index 706fc9ab7..c3f504675 100644 --- a/tests/testsuite/cargo_add/git_tag/mod.rs +++ b/tests/testsuite/cargo_add/git_tag/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let (git_dep, git_repo) = cargo_test_support::git::new_repo("git-package", |project| { @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/help/mod.rs b/tests/testsuite/cargo_add/help/mod.rs index 0962047f8..15f9a6a04 100644 --- a/tests/testsuite/cargo_add/help/mod.rs +++ b/tests/testsuite/cargo_add/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_add/infer_prerelease/mod.rs b/tests/testsuite/cargo_add/infer_prerelease/mod.rs index f2b49376a..e36b8dd0b 100644 --- a/tests/testsuite/cargo_add/infer_prerelease/mod.rs +++ b/tests/testsuite/cargo_add/infer_prerelease/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("prerelease_only", "0.2.0-alpha.1").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/invalid_arg/mod.rs b/tests/testsuite/cargo_add/invalid_arg/mod.rs index a4e4d268a..45627df21 100644 --- a/tests/testsuite/cargo_add/invalid_arg/mod.rs +++ b/tests/testsuite/cargo_add/invalid_arg/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_git_name/mod.rs b/tests/testsuite/cargo_add/invalid_git_name/mod.rs index 2f407105d..e9b888d35 100644 --- a/tests/testsuite/cargo_add/invalid_git_name/mod.rs +++ b/tests/testsuite/cargo_add/invalid_git_name/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; let git_dep = cargo_test_support::git::new("git-package", |project| { @@ -27,8 +27,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_key_inherit_dependency/mod.rs b/tests/testsuite/cargo_add/invalid_key_inherit_dependency/mod.rs index 837293e5f..50acea2a6 100644 --- a/tests/testsuite/cargo_add/invalid_key_inherit_dependency/mod.rs +++ b/tests/testsuite/cargo_add/invalid_key_inherit_dependency/mod.rs @@ -1,12 +1,12 @@ 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; @@ -16,8 +16,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/invalid_key_overwrite_inherit_dependency/mod.rs b/tests/testsuite/cargo_add/invalid_key_overwrite_inherit_dependency/mod.rs index 837293e5f..50acea2a6 100644 --- a/tests/testsuite/cargo_add/invalid_key_overwrite_inherit_dependency/mod.rs +++ b/tests/testsuite/cargo_add/invalid_key_overwrite_inherit_dependency/mod.rs @@ -1,12 +1,12 @@ 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; @@ -16,8 +16,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/invalid_key_rename_inherit_dependency/mod.rs b/tests/testsuite/cargo_add/invalid_key_rename_inherit_dependency/mod.rs index bee132560..a56d7b5fc 100644 --- a/tests/testsuite/cargo_add/invalid_key_rename_inherit_dependency/mod.rs +++ b/tests/testsuite/cargo_add/invalid_key_rename_inherit_dependency/mod.rs @@ -1,12 +1,12 @@ 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; @@ -16,8 +16,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/invalid_manifest/mod.rs b/tests/testsuite/cargo_add/invalid_manifest/mod.rs index 4a2d01765..488f543d4 100644 --- a/tests/testsuite/cargo_add/invalid_manifest/mod.rs +++ b/tests/testsuite/cargo_add/invalid_manifest/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_name_external/mod.rs b/tests/testsuite/cargo_add/invalid_name_external/mod.rs index 8cb9b5129..7fc0868f4 100644 --- a/tests/testsuite/cargo_add/invalid_name_external/mod.rs +++ b/tests/testsuite/cargo_add/invalid_name_external/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_path/mod.rs b/tests/testsuite/cargo_add/invalid_path/mod.rs index d8e6a34a6..0b3a5ec8d 100644 --- a/tests/testsuite/cargo_add/invalid_path/mod.rs +++ b/tests/testsuite/cargo_add/invalid_path/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_path_name/mod.rs b/tests/testsuite/cargo_add/invalid_path_name/mod.rs index aec088020..264a3f1ee 100644 --- a/tests/testsuite/cargo_add/invalid_path_name/mod.rs +++ b/tests/testsuite/cargo_add/invalid_path_name/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ fn case() { .current_dir(&cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_path_self/mod.rs b/tests/testsuite/cargo_add/invalid_path_self/mod.rs index 4bb32531b..627d46a6b 100644 --- a/tests/testsuite/cargo_add/invalid_path_self/mod.rs +++ b/tests/testsuite/cargo_add/invalid_path_self/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_target_empty/mod.rs b/tests/testsuite/cargo_add/invalid_target_empty/mod.rs index 43b3a4a79..93448e865 100644 --- a/tests/testsuite/cargo_add/invalid_target_empty/mod.rs +++ b/tests/testsuite/cargo_add/invalid_target_empty/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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); } diff --git a/tests/testsuite/cargo_add/invalid_vers/mod.rs b/tests/testsuite/cargo_add/invalid_vers/mod.rs index 2ad903d1f..abaa1b29a 100644 --- a/tests/testsuite/cargo_add/invalid_vers/mod.rs +++ b/tests/testsuite/cargo_add/invalid_vers/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/list_features/mod.rs b/tests/testsuite/cargo_add/list_features/mod.rs index 0dbf824d0..be5d0a05f 100644 --- a/tests/testsuite/cargo_add/list_features/mod.rs +++ b/tests/testsuite/cargo_add/list_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/list_features_path/mod.rs b/tests/testsuite/cargo_add/list_features_path/mod.rs index e58de1c1d..780c8485b 100644 --- a/tests/testsuite/cargo_add/list_features_path/mod.rs +++ b/tests/testsuite/cargo_add/list_features_path/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -25,7 +25,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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.join("primary"); @@ -35,8 +35,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs b/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs index 0aa20873e..2e179e5ad 100644 --- a/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs +++ b/tests/testsuite/cargo_add/list_features_path_no_default/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -25,7 +25,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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.join("primary"); @@ -40,8 +40,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/locked_changed/mod.rs b/tests/testsuite/cargo_add/locked_changed/mod.rs index 5de047f57..7111027a4 100644 --- a/tests/testsuite/cargo_add/locked_changed/mod.rs +++ b/tests/testsuite/cargo_add/locked_changed/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/locked_unchanged/mod.rs b/tests/testsuite/cargo_add/locked_unchanged/mod.rs index 613d8c863..dd7682658 100644 --- a/tests/testsuite/cargo_add/locked_unchanged/mod.rs +++ b/tests/testsuite/cargo_add/locked_unchanged/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/lockfile_updated/mod.rs b/tests/testsuite/cargo_add/lockfile_updated/mod.rs index 4e99a18ef..b911d451c 100644 --- a/tests/testsuite/cargo_add/lockfile_updated/mod.rs +++ b/tests/testsuite/cargo_add/lockfile_updated/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/manifest_path_package/mod.rs b/tests/testsuite/cargo_add/manifest_path_package/mod.rs index 768cdb3a3..ae015d49a 100644 --- a/tests/testsuite/cargo_add/manifest_path_package/mod.rs +++ b/tests/testsuite/cargo_add/manifest_path_package/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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; @@ -36,8 +36,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/merge_activated_features/mod.rs b/tests/testsuite/cargo_add/merge_activated_features/mod.rs index 161783282..45b6b359d 100644 --- a/tests/testsuite/cargo_add/merge_activated_features/mod.rs +++ b/tests/testsuite/cargo_add/merge_activated_features/mod.rs @@ -1,12 +1,12 @@ 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; @@ -16,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/multiple_conflicts_with_features/mod.rs b/tests/testsuite/cargo_add/multiple_conflicts_with_features/mod.rs index 3cdad0e72..f818b1c68 100644 --- a/tests/testsuite/cargo_add/multiple_conflicts_with_features/mod.rs +++ b/tests/testsuite/cargo_add/multiple_conflicts_with_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -25,7 +25,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -35,8 +35,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/multiple_conflicts_with_rename/mod.rs b/tests/testsuite/cargo_add/multiple_conflicts_with_rename/mod.rs index 9a94dcffa..ad68456df 100644 --- a/tests/testsuite/cargo_add/multiple_conflicts_with_rename/mod.rs +++ b/tests/testsuite/cargo_add/multiple_conflicts_with_rename/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/namever/mod.rs b/tests/testsuite/cargo_add/namever/mod.rs index 063072c79..03c9ab4cc 100644 --- a/tests/testsuite/cargo_add/namever/mod.rs +++ b/tests/testsuite/cargo_add/namever/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/no_args/mod.rs b/tests/testsuite/cargo_add/no_args/mod.rs index aca1e5422..9a57b3c87 100644 --- a/tests/testsuite/cargo_add/no_args/mod.rs +++ b/tests/testsuite/cargo_add/no_args/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -17,8 +17,8 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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); } diff --git a/tests/testsuite/cargo_add/no_default_features/mod.rs b/tests/testsuite/cargo_add/no_default_features/mod.rs index 8a5d41c8d..6824244e6 100644 --- a/tests/testsuite/cargo_add/no_default_features/mod.rs +++ b/tests/testsuite/cargo_add/no_default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/no_optional/mod.rs b/tests/testsuite/cargo_add/no_optional/mod.rs index cc7e79b97..042f1de9f 100644 --- a/tests/testsuite/cargo_add/no_optional/mod.rs +++ b/tests/testsuite/cargo_add/no_optional/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/no_public/mod.rs b/tests/testsuite/cargo_add/no_public/mod.rs index 912ac3fd3..b435df9de 100644 --- a/tests/testsuite/cargo_add/no_public/mod.rs +++ b/tests/testsuite/cargo_add/no_public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ fn case() { .masquerade_as_nightly_cargo(&["public-dependency"]) .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); } diff --git a/tests/testsuite/cargo_add/offline_empty_cache/mod.rs b/tests/testsuite/cargo_add/offline_empty_cache/mod.rs index 055b6a8a2..5fd1e5697 100644 --- a/tests/testsuite/cargo_add/offline_empty_cache/mod.rs +++ b/tests/testsuite/cargo_add/offline_empty_cache/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/optional/mod.rs b/tests/testsuite/cargo_add/optional/mod.rs index 8daaa961d..4a9ede95c 100644 --- a/tests/testsuite/cargo_add/optional/mod.rs +++ b/tests/testsuite/cargo_add/optional/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_default_features/mod.rs b/tests/testsuite/cargo_add/overwrite_default_features/mod.rs index 9d313b9d9..6994260ab 100644 --- a/tests/testsuite/cargo_add/overwrite_default_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_default_features_with_no_default_features/mod.rs b/tests/testsuite/cargo_add/overwrite_default_features_with_no_default_features/mod.rs index 8a5d41c8d..6824244e6 100644 --- a/tests/testsuite/cargo_add/overwrite_default_features_with_no_default_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_default_features_with_no_default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_features/mod.rs b/tests/testsuite/cargo_add/overwrite_features/mod.rs index da55fced2..6e6a258de 100644 --- a/tests/testsuite/cargo_add/overwrite_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_git_with_path/mod.rs b/tests/testsuite/cargo_add/overwrite_git_with_path/mod.rs index fd63cc709..169999686 100644 --- a/tests/testsuite/cargo_add/overwrite_git_with_path/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_git_with_path/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_inherit_features_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_inherit_features_noop/mod.rs index 2b9550ce0..60b454d32 100644 --- a/tests/testsuite/cargo_add/overwrite_inherit_features_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_inherit_features_noop/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_inherit_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_inherit_noop/mod.rs index 2b9550ce0..60b454d32 100644 --- a/tests/testsuite/cargo_add/overwrite_inherit_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_inherit_noop/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_inherit_optional_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_inherit_optional_noop/mod.rs index 2b9550ce0..60b454d32 100644 --- a/tests/testsuite/cargo_add/overwrite_inherit_optional_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_inherit_optional_noop/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_inline_features/mod.rs b/tests/testsuite/cargo_add/overwrite_inline_features/mod.rs index 52ad6968a..6ee3a244a 100644 --- a/tests/testsuite/cargo_add/overwrite_inline_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_inline_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -25,7 +25,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -37,8 +37,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_name_dev_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_name_dev_noop/mod.rs index ea37368d5..934b249e8 100644 --- a/tests/testsuite/cargo_add/overwrite_name_dev_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_name_dev_noop/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::alt_init(); @@ -15,7 +15,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -25,8 +25,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_name_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_name_noop/mod.rs index 120be4429..0de6b7d2f 100644 --- a/tests/testsuite/cargo_add/overwrite_name_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_name_noop/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::alt_init(); @@ -15,7 +15,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -25,8 +25,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_no_default_features/mod.rs b/tests/testsuite/cargo_add/overwrite_no_default_features/mod.rs index 8a5d41c8d..6824244e6 100644 --- a/tests/testsuite/cargo_add/overwrite_no_default_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_no_default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_no_default_features_with_default_features/mod.rs b/tests/testsuite/cargo_add/overwrite_no_default_features_with_default_features/mod.rs index 9d313b9d9..6994260ab 100644 --- a/tests/testsuite/cargo_add/overwrite_no_default_features_with_default_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_no_default_features_with_default_features/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_no_optional/mod.rs b/tests/testsuite/cargo_add/overwrite_no_optional/mod.rs index cc7e79b97..042f1de9f 100644 --- a/tests/testsuite/cargo_add/overwrite_no_optional/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_no_optional/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_no_optional_with_optional/mod.rs b/tests/testsuite/cargo_add/overwrite_no_optional_with_optional/mod.rs index 8daaa961d..4a9ede95c 100644 --- a/tests/testsuite/cargo_add/overwrite_no_optional_with_optional/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_no_optional_with_optional/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_no_public/mod.rs b/tests/testsuite/cargo_add/overwrite_no_public/mod.rs index 912ac3fd3..b435df9de 100644 --- a/tests/testsuite/cargo_add/overwrite_no_public/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_no_public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ fn case() { .masquerade_as_nightly_cargo(&["public-dependency"]) .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); } diff --git a/tests/testsuite/cargo_add/overwrite_no_public_with_public/mod.rs b/tests/testsuite/cargo_add/overwrite_no_public_with_public/mod.rs index bbf8d65a6..e95fceeeb 100644 --- a/tests/testsuite/cargo_add/overwrite_no_public_with_public/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_no_public_with_public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ fn case() { .masquerade_as_nightly_cargo(&["public-dependency"]) .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); } diff --git a/tests/testsuite/cargo_add/overwrite_optional/mod.rs b/tests/testsuite/cargo_add/overwrite_optional/mod.rs index 8daaa961d..4a9ede95c 100644 --- a/tests/testsuite/cargo_add/overwrite_optional/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_optional/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs index 511b31e29..820613c18 100644 --- a/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_optional_with_no_optional/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -15,7 +15,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -25,8 +25,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_optional_with_optional/mod.rs b/tests/testsuite/cargo_add/overwrite_optional_with_optional/mod.rs index 434124e93..4f39b5613 100644 --- a/tests/testsuite/cargo_add/overwrite_optional_with_optional/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_optional_with_optional/mod.rs @@ -1,15 +1,15 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package1", "99999.0.0").publish(); - 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; @@ -19,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_path_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_path_noop/mod.rs index fc057d852..147fb02c6 100644 --- a/tests/testsuite/cargo_add/overwrite_path_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_path_noop/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::alt_init(); @@ -15,7 +15,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -25,8 +25,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_path_with_version/mod.rs b/tests/testsuite/cargo_add/overwrite_path_with_version/mod.rs index bb93cfa15..769d59774 100644 --- a/tests/testsuite/cargo_add/overwrite_path_with_version/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_path_with_version/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_preserves_inline_table/mod.rs b/tests/testsuite/cargo_add/overwrite_preserves_inline_table/mod.rs index da55fced2..6e6a258de 100644 --- a/tests/testsuite/cargo_add/overwrite_preserves_inline_table/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_preserves_inline_table/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_public/mod.rs b/tests/testsuite/cargo_add/overwrite_public/mod.rs index bbf8d65a6..e95fceeeb 100644 --- a/tests/testsuite/cargo_add/overwrite_public/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ fn case() { .masquerade_as_nightly_cargo(&["public-dependency"]) .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); } diff --git a/tests/testsuite/cargo_add/overwrite_public_with_no_public/mod.rs b/tests/testsuite/cargo_add/overwrite_public_with_no_public/mod.rs index 912ac3fd3..b435df9de 100644 --- a/tests/testsuite/cargo_add/overwrite_public_with_no_public/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_public_with_no_public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ fn case() { .masquerade_as_nightly_cargo(&["public-dependency"]) .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); } diff --git a/tests/testsuite/cargo_add/overwrite_rename_with_no_rename/mod.rs b/tests/testsuite/cargo_add/overwrite_rename_with_no_rename/mod.rs index ea49a07c1..e643e817a 100644 --- a/tests/testsuite/cargo_add/overwrite_rename_with_no_rename/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_rename_with_no_rename/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("versioned-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_rename_with_rename/mod.rs b/tests/testsuite/cargo_add/overwrite_rename_with_rename/mod.rs index af96caef5..09edae3aa 100644 --- a/tests/testsuite/cargo_add/overwrite_rename_with_rename/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_rename_with_rename/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("versioned-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_rename_with_rename_noop/mod.rs b/tests/testsuite/cargo_add/overwrite_rename_with_rename_noop/mod.rs index 734d0b99a..35f27d38d 100644 --- a/tests/testsuite/cargo_add/overwrite_rename_with_rename_noop/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_rename_with_rename_noop/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("versioned-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs b/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs index fcf0aa5e6..91a4d3917 100644 --- a/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("versioned-package", ver).publish(); } - 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; let git_dep = cargo_test_support::git::new("versioned-package", |project| { @@ -38,8 +38,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_version_with_path/mod.rs b/tests/testsuite/cargo_add/overwrite_version_with_path/mod.rs index fd63cc709..169999686 100644 --- a/tests/testsuite/cargo_add/overwrite_version_with_path/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_version_with_path/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_with_rename/mod.rs b/tests/testsuite/cargo_add/overwrite_with_rename/mod.rs index 49a0ae0eb..0c00a2d2b 100644 --- a/tests/testsuite/cargo_add/overwrite_with_rename/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_with_rename/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("versioned-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_workspace_dep/mod.rs b/tests/testsuite/cargo_add/overwrite_workspace_dep/mod.rs index 15cfa571c..9be71d5ea 100644 --- a/tests/testsuite/cargo_add/overwrite_workspace_dep/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_workspace_dep/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/overwrite_workspace_dep_features/mod.rs b/tests/testsuite/cargo_add/overwrite_workspace_dep_features/mod.rs index 15cfa571c..9be71d5ea 100644 --- a/tests/testsuite/cargo_add/overwrite_workspace_dep_features/mod.rs +++ b/tests/testsuite/cargo_add/overwrite_workspace_dep_features/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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; @@ -18,8 +18,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/path/mod.rs b/tests/testsuite/cargo_add/path/mod.rs index fd63cc709..169999686 100644 --- a/tests/testsuite/cargo_add/path/mod.rs +++ b/tests/testsuite/cargo_add/path/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/path_dev/mod.rs b/tests/testsuite/cargo_add/path_dev/mod.rs index 478e602a2..29c71d0fd 100644 --- a/tests/testsuite/cargo_add/path_dev/mod.rs +++ b/tests/testsuite/cargo_add/path_dev/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/path_inferred_name/mod.rs b/tests/testsuite/cargo_add/path_inferred_name/mod.rs index fd63cc709..169999686 100644 --- a/tests/testsuite/cargo_add/path_inferred_name/mod.rs +++ b/tests/testsuite/cargo_add/path_inferred_name/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs b/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs index 17c328ea6..1313677a3 100644 --- a/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs +++ b/tests/testsuite/cargo_add/path_inferred_name_conflicts_full_feature/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); - 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.join("primary"); @@ -18,8 +18,8 @@ fn case() { .current_dir(&cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_add/path_normalized_name/mod.rs b/tests/testsuite/cargo_add/path_normalized_name/mod.rs index 8ae8a4e7d..22273d0fd 100644 --- a/tests/testsuite/cargo_add/path_normalized_name/mod.rs +++ b/tests/testsuite/cargo_add/path_normalized_name/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ fn case() { .current_dir(&cwd) .assert() .failure() // Fuzzy searching for paths isn't supported at this time - .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); } diff --git a/tests/testsuite/cargo_add/preserve_dep_std_table/mod.rs b/tests/testsuite/cargo_add/preserve_dep_std_table/mod.rs index 1998fa742..d71529685 100644 --- a/tests/testsuite/cargo_add/preserve_dep_std_table/mod.rs +++ b/tests/testsuite/cargo_add/preserve_dep_std_table/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/preserve_features_table/mod.rs b/tests/testsuite/cargo_add/preserve_features_table/mod.rs index 1998fa742..d71529685 100644 --- a/tests/testsuite/cargo_add/preserve_features_table/mod.rs +++ b/tests/testsuite/cargo_add/preserve_features_table/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/preserve_sorted/mod.rs b/tests/testsuite/cargo_add/preserve_sorted/mod.rs index aef0d3d2f..57cd63a32 100644 --- a/tests/testsuite/cargo_add/preserve_sorted/mod.rs +++ b/tests/testsuite/cargo_add/preserve_sorted/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/preserve_unsorted/mod.rs b/tests/testsuite/cargo_add/preserve_unsorted/mod.rs index aef0d3d2f..57cd63a32 100644 --- a/tests/testsuite/cargo_add/preserve_unsorted/mod.rs +++ b/tests/testsuite/cargo_add/preserve_unsorted/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/public/mod.rs b/tests/testsuite/cargo_add/public/mod.rs index bbf8d65a6..e95fceeeb 100644 --- a/tests/testsuite/cargo_add/public/mod.rs +++ b/tests/testsuite/cargo_add/public/mod.rs @@ -1,14 +1,14 @@ 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() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("my-package", "0.1.0").publish(); - 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; @@ -19,8 +19,8 @@ fn case() { .masquerade_as_nightly_cargo(&["public-dependency"]) .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); } diff --git a/tests/testsuite/cargo_add/quiet/mod.rs b/tests/testsuite/cargo_add/quiet/mod.rs index 1a02b0802..c570aabd8 100644 --- a/tests/testsuite/cargo_add/quiet/mod.rs +++ b/tests/testsuite/cargo_add/quiet/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/registry/mod.rs b/tests/testsuite/cargo_add/registry/mod.rs index d0d937815..c7693f13e 100644 --- a/tests/testsuite/cargo_add/registry/mod.rs +++ b/tests/testsuite/cargo_add/registry/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::alt_init(); @@ -23,7 +23,7 @@ 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; @@ -33,8 +33,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/rename/mod.rs b/tests/testsuite/cargo_add/rename/mod.rs index 28c92d770..754c078d0 100644 --- a/tests/testsuite/cargo_add/rename/mod.rs +++ b/tests/testsuite/cargo_add/rename/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/require_weak/mod.rs b/tests/testsuite/cargo_add/require_weak/mod.rs index 1998fa742..d71529685 100644 --- a/tests/testsuite/cargo_add/require_weak/mod.rs +++ b/tests/testsuite/cargo_add/require_weak/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .feature("ears", &[]) .publish(); - 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; @@ -24,8 +24,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/rust_version_ignore/mod.rs b/tests/testsuite/cargo_add/rust_version_ignore/mod.rs index 0404d12b4..198aecb76 100644 --- a/tests/testsuite/cargo_add/rust_version_ignore/mod.rs +++ b/tests/testsuite/cargo_add/rust_version_ignore/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .rust_version("1.72") .publish(); - 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; @@ -27,8 +27,8 @@ fn case() { .masquerade_as_nightly_cargo(&["msrv-policy"]) .assert() .code(0) - .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); } diff --git a/tests/testsuite/cargo_add/rust_version_incompatible/mod.rs b/tests/testsuite/cargo_add/rust_version_incompatible/mod.rs index 31fb57786..5aa25e36d 100644 --- a/tests/testsuite/cargo_add/rust_version_incompatible/mod.rs +++ b/tests/testsuite/cargo_add/rust_version_incompatible/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -17,7 +17,7 @@ fn case() { .rust_version("1.72") .publish(); - 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; @@ -29,8 +29,8 @@ fn case() { .masquerade_as_nightly_cargo(&["msrv-policy"]) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/rust_version_latest/mod.rs b/tests/testsuite/cargo_add/rust_version_latest/mod.rs index 7a42c566e..35247741c 100644 --- a/tests/testsuite/cargo_add/rust_version_latest/mod.rs +++ b/tests/testsuite/cargo_add/rust_version_latest/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .rust_version("1.72") .publish(); - 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; @@ -26,8 +26,8 @@ fn case() { .masquerade_as_nightly_cargo(&["msrv-policy"]) .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); } diff --git a/tests/testsuite/cargo_add/rust_version_older/mod.rs b/tests/testsuite/cargo_add/rust_version_older/mod.rs index 7a42c566e..35247741c 100644 --- a/tests/testsuite/cargo_add/rust_version_older/mod.rs +++ b/tests/testsuite/cargo_add/rust_version_older/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -14,7 +14,7 @@ fn case() { .rust_version("1.72") .publish(); - 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; @@ -26,8 +26,8 @@ fn case() { .masquerade_as_nightly_cargo(&["msrv-policy"]) .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); } diff --git a/tests/testsuite/cargo_add/sorted_table_with_dotted_item/mod.rs b/tests/testsuite/cargo_add/sorted_table_with_dotted_item/mod.rs index 46e8708a1..efa82f81e 100644 --- a/tests/testsuite/cargo_add/sorted_table_with_dotted_item/mod.rs +++ b/tests/testsuite/cargo_add/sorted_table_with_dotted_item/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -26,7 +26,7 @@ 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; @@ -36,8 +36,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/target/mod.rs b/tests/testsuite/cargo_add/target/mod.rs index b47874949..23f0edfdc 100644 --- a/tests/testsuite/cargo_add/target/mod.rs +++ b/tests/testsuite/cargo_add/target/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/target_cfg/mod.rs b/tests/testsuite/cargo_add/target_cfg/mod.rs index 0478ece76..9846f5837 100644 --- a/tests/testsuite/cargo_add/target_cfg/mod.rs +++ b/tests/testsuite/cargo_add/target_cfg/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -21,7 +21,7 @@ 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; @@ -31,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/unknown_inherited_feature/mod.rs b/tests/testsuite/cargo_add/unknown_inherited_feature/mod.rs index 8184dac8f..d0d2213ea 100644 --- a/tests/testsuite/cargo_add/unknown_inherited_feature/mod.rs +++ b/tests/testsuite/cargo_add/unknown_inherited_feature/mod.rs @@ -1,12 +1,12 @@ 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; @@ -16,8 +16,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_add/vers/mod.rs b/tests/testsuite/cargo_add/vers/mod.rs index ee7dab2d1..1f097d1b5 100644 --- a/tests/testsuite/cargo_add/vers/mod.rs +++ b/tests/testsuite/cargo_add/vers/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -19,7 +19,7 @@ fn case() { cargo_test_support::registry::Package::new("my-package", ver).publish(); } - 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; @@ -29,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/workspace_name/mod.rs b/tests/testsuite/cargo_add/workspace_name/mod.rs index 2ab0807de..1e49edb57 100644 --- a/tests/testsuite/cargo_add/workspace_name/mod.rs +++ b/tests/testsuite/cargo_add/workspace_name/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/workspace_path/mod.rs b/tests/testsuite/cargo_add/workspace_path/mod.rs index fd63cc709..169999686 100644 --- a/tests/testsuite/cargo_add/workspace_path/mod.rs +++ b/tests/testsuite/cargo_add/workspace_path/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_add/workspace_path_dev/mod.rs b/tests/testsuite/cargo_add/workspace_path_dev/mod.rs index 478e602a2..29c71d0fd 100644 --- a/tests/testsuite/cargo_add/workspace_path_dev/mod.rs +++ b/tests/testsuite/cargo_add/workspace_path_dev/mod.rs @@ -1,9 +1,9 @@ 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() { cargo_test_support::registry::init(); @@ -20,7 +20,7 @@ fn case() { .publish(); } - 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.join("primary"); @@ -30,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_bench/help/mod.rs b/tests/testsuite/cargo_bench/help/mod.rs index 9338664e5..104399937 100644 --- a/tests/testsuite/cargo_bench/help/mod.rs +++ b/tests/testsuite/cargo_bench/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_bench/no_keep_going/mod.rs b/tests/testsuite/cargo_bench/no_keep_going/mod.rs index 6ed5f81f9..f996444d6 100644 --- a/tests/testsuite/cargo_bench/no_keep_going/mod.rs +++ b/tests/testsuite/cargo_bench/no_keep_going/mod.rs @@ -1,10 +1,11 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -14,6 +15,6 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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"]); } diff --git a/tests/testsuite/cargo_build/help/mod.rs b/tests/testsuite/cargo_build/help/mod.rs index 9ca23b478..d1271bf1f 100644 --- a/tests/testsuite/cargo_build/help/mod.rs +++ b/tests/testsuite/cargo_build/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_check/help/mod.rs b/tests/testsuite/cargo_check/help/mod.rs index 71571bc95..32d87803f 100644 --- a/tests/testsuite/cargo_check/help/mod.rs +++ b/tests/testsuite/cargo_check/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_clean/help/mod.rs b/tests/testsuite/cargo_clean/help/mod.rs index 7225292b8..d4efe3c36 100644 --- a/tests/testsuite/cargo_clean/help/mod.rs +++ b/tests/testsuite/cargo_clean/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_config/help/mod.rs b/tests/testsuite/cargo_config/help/mod.rs index 070238ef0..20bcef683 100644 --- a/tests/testsuite/cargo_config/help/mod.rs +++ b/tests/testsuite/cargo_config/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_doc/help/mod.rs b/tests/testsuite/cargo_doc/help/mod.rs index b0fd4f3e8..4fc28adba 100644 --- a/tests/testsuite/cargo_doc/help/mod.rs +++ b/tests/testsuite/cargo_doc/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_fetch/help/mod.rs b/tests/testsuite/cargo_fetch/help/mod.rs index 79025bc32..b0f8349f0 100644 --- a/tests/testsuite/cargo_fetch/help/mod.rs +++ b/tests/testsuite/cargo_fetch/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_fix/help/mod.rs b/tests/testsuite/cargo_fix/help/mod.rs index 2c67e1556..2a43ad544 100644 --- a/tests/testsuite/cargo_fix/help/mod.rs +++ b/tests/testsuite/cargo_fix/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_generate_lockfile/help/mod.rs b/tests/testsuite/cargo_generate_lockfile/help/mod.rs index 0408ce06b..c22fb622f 100644 --- a/tests/testsuite/cargo_generate_lockfile/help/mod.rs +++ b/tests/testsuite/cargo_generate_lockfile/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_git_checkout/help/mod.rs b/tests/testsuite/cargo_git_checkout/help/mod.rs index 5ff877fbb..a11c97870 100644 --- a/tests/testsuite/cargo_git_checkout/help/mod.rs +++ b/tests/testsuite/cargo_git_checkout/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_help/help/mod.rs b/tests/testsuite/cargo_help/help/mod.rs index af445cda1..ef54d25b3 100644 --- a/tests/testsuite/cargo_help/help/mod.rs +++ b/tests/testsuite/cargo_help/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_init/auto_git/mod.rs b/tests/testsuite/cargo_init/auto_git/mod.rs index 68c217520..992fe1d12 100644 --- a/tests/testsuite/cargo_init/auto_git/mod.rs +++ b/tests/testsuite/cargo_init/auto_git/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/bin_already_exists_explicit/mod.rs b/tests/testsuite/cargo_init/bin_already_exists_explicit/mod.rs index 326bd218a..470f4b2de 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_explicit/mod.rs +++ b/tests/testsuite/cargo_init/bin_already_exists_explicit/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/mod.rs b/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/mod.rs index 1f16fb659..43f5a4194 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/mod.rs +++ b/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join("src").is_dir()); } diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit/mod.rs b/tests/testsuite/cargo_init/bin_already_exists_implicit/mod.rs index 12349a09b..bcbb78be1 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit/mod.rs +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/mod.rs b/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/mod.rs index fe65940db..8c6ae8acb 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/mod.rs +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join("src").is_dir()); } diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/mod.rs b/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/mod.rs index d3e8e66df..d07cd385c 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/mod.rs +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join("src/main.rs").is_file()); } diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/mod.rs b/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/mod.rs index fe65940db..8c6ae8acb 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/mod.rs +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join("src").is_dir()); } diff --git a/tests/testsuite/cargo_init/both_lib_and_bin/mod.rs b/tests/testsuite/cargo_init/both_lib_and_bin/mod.rs index c9232320a..2be403177 100644 --- a/tests/testsuite/cargo_init/both_lib_and_bin/mod.rs +++ b/tests/testsuite/cargo_init/both_lib_and_bin/mod.rs @@ -1,8 +1,7 @@ +use cargo_test_support::file; use cargo_test_support::paths; use cargo_test_support::prelude::*; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { let cwd = paths::root(); @@ -12,8 +11,8 @@ fn case() { .current_dir(&cwd) .assert() .code(101) - .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!(!cwd.join("Cargo.toml").is_file()); } diff --git a/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/mod.rs b/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/mod.rs index 5e9e1b94c..cc398155c 100644 --- a/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/mod.rs +++ b/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/mod.rs @@ -1,11 +1,11 @@ +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(); snapbox::cmd::Command::cargo_ui() @@ -13,6 +13,6 @@ fn case() { .current_dir(project_root) .assert() .code(101) - .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"]); } diff --git a/tests/testsuite/cargo_init/confused_by_multiple_lib_files/mod.rs b/tests/testsuite/cargo_init/confused_by_multiple_lib_files/mod.rs index d1cba2ff7..62fd751d6 100644 --- a/tests/testsuite/cargo_init/confused_by_multiple_lib_files/mod.rs +++ b/tests/testsuite/cargo_init/confused_by_multiple_lib_files/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .assert() .code(101) - .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); assert!(!project_root.join("Cargo.toml").is_file()); } diff --git a/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/mod.rs b/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/mod.rs index 326bd218a..470f4b2de 100644 --- a/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/mod.rs +++ b/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/mod.rs b/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/mod.rs index 326bd218a..470f4b2de 100644 --- a/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/mod.rs +++ b/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/mod.rs b/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/mod.rs index 59c192cb9..cd1d2046d 100644 --- a/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/mod.rs +++ b/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/explicit_bin_with_git/mod.rs b/tests/testsuite/cargo_init/explicit_bin_with_git/mod.rs index 7314e955c..7c1efb243 100644 --- a/tests/testsuite/cargo_init/explicit_bin_with_git/mod.rs +++ b/tests/testsuite/cargo_init/explicit_bin_with_git/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/formats_source/mod.rs b/tests/testsuite/cargo_init/formats_source/mod.rs index ac1fb6271..5d2c72b15 100644 --- a/tests/testsuite/cargo_init/formats_source/mod.rs +++ b/tests/testsuite/cargo_init/formats_source/mod.rs @@ -1,9 +1,9 @@ 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::{process, Project}; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { // This cannot use `requires_rustfmt` because rustfmt is not available in @@ -14,7 +14,7 @@ fn case() { eprintln!("skipping test, rustfmt not available:\n{e:?}"); return; } - let project = Project::from_template(curr_dir!().join("in")); + let project = Project::from_template(current_dir!().join("in")); let project_root = &project.root(); snapbox::cmd::Command::cargo_ui() @@ -22,8 +22,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/fossil_autodetect/mod.rs b/tests/testsuite/cargo_init/fossil_autodetect/mod.rs index d45ba868a..0a5ba570e 100644 --- a/tests/testsuite/cargo_init/fossil_autodetect/mod.rs +++ b/tests/testsuite/cargo_init/fossil_autodetect/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/git_autodetect/mod.rs b/tests/testsuite/cargo_init/git_autodetect/mod.rs index aef47bc7d..ae6963aba 100644 --- a/tests/testsuite/cargo_init/git_autodetect/mod.rs +++ b/tests/testsuite/cargo_init/git_autodetect/mod.rs @@ -1,10 +1,10 @@ use cargo_test_support::compare::assert_ui; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::paths; use cargo_test_support::prelude::*; use std::fs; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { let project_root = &paths::root().join("foo"); @@ -16,9 +16,9 @@ fn case() { .current_dir(project_root) .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); assert!(project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/mod.rs b/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/mod.rs index cd4437c65..3522534ca 100644 --- a/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/mod.rs +++ b/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/help/mod.rs b/tests/testsuite/cargo_init/help/mod.rs index 7f00d347a..58febefe8 100644 --- a/tests/testsuite/cargo_init/help/mod.rs +++ b/tests/testsuite/cargo_init/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_init/ignores_failure_to_format_source/mod.rs b/tests/testsuite/cargo_init/ignores_failure_to_format_source/mod.rs index fd9394049..b2b927a4e 100644 --- a/tests/testsuite/cargo_init/ignores_failure_to_format_source/mod.rs +++ b/tests/testsuite/cargo_init/ignores_failure_to_format_source/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -15,8 +15,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/inferred_bin_with_git/mod.rs b/tests/testsuite/cargo_init/inferred_bin_with_git/mod.rs index 80bec8893..619045a0c 100644 --- a/tests/testsuite/cargo_init/inferred_bin_with_git/mod.rs +++ b/tests/testsuite/cargo_init/inferred_bin_with_git/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/inferred_lib_with_git/mod.rs b/tests/testsuite/cargo_init/inferred_lib_with_git/mod.rs index 80bec8893..619045a0c 100644 --- a/tests/testsuite/cargo_init/inferred_lib_with_git/mod.rs +++ b/tests/testsuite/cargo_init/inferred_lib_with_git/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/inherit_workspace_package_table/mod.rs b/tests/testsuite/cargo_init/inherit_workspace_package_table/mod.rs index 4e1dda845..3132705f3 100644 --- a/tests/testsuite/cargo_init/inherit_workspace_package_table/mod.rs +++ b/tests/testsuite/cargo_init/inherit_workspace_package_table/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_init/invalid_dir_name/mod.rs b/tests/testsuite/cargo_init/invalid_dir_name/mod.rs index 2b1be9022..52f96cf35 100644 --- a/tests/testsuite/cargo_init/invalid_dir_name/mod.rs +++ b/tests/testsuite/cargo_init/invalid_dir_name/mod.rs @@ -1,9 +1,8 @@ +use cargo_test_support::file; use cargo_test_support::paths; use cargo_test_support::prelude::*; use std::fs; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { let foo = &paths::root().join("foo.bar"); @@ -14,8 +13,8 @@ fn case() { .current_dir(foo) .assert() .code(101) - .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!(!foo.join("Cargo.toml").is_file()); } diff --git a/tests/testsuite/cargo_init/lib_already_exists_nosrc/mod.rs b/tests/testsuite/cargo_init/lib_already_exists_nosrc/mod.rs index d3e8e66df..d07cd385c 100644 --- a/tests/testsuite/cargo_init/lib_already_exists_nosrc/mod.rs +++ b/tests/testsuite/cargo_init/lib_already_exists_nosrc/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join("src/main.rs").is_file()); } diff --git a/tests/testsuite/cargo_init/lib_already_exists_src/mod.rs b/tests/testsuite/cargo_init/lib_already_exists_src/mod.rs index d3e8e66df..d07cd385c 100644 --- a/tests/testsuite/cargo_init/lib_already_exists_src/mod.rs +++ b/tests/testsuite/cargo_init/lib_already_exists_src/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join("src/main.rs").is_file()); } diff --git a/tests/testsuite/cargo_init/mercurial_autodetect/mod.rs b/tests/testsuite/cargo_init/mercurial_autodetect/mod.rs index d45ba868a..0a5ba570e 100644 --- a/tests/testsuite/cargo_init/mercurial_autodetect/mod.rs +++ b/tests/testsuite/cargo_init/mercurial_autodetect/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/multibin_project_name_clash/mod.rs b/tests/testsuite/cargo_init/multibin_project_name_clash/mod.rs index fdd4476d9..5f2693e3f 100644 --- a/tests/testsuite/cargo_init/multibin_project_name_clash/mod.rs +++ b/tests/testsuite/cargo_init/multibin_project_name_clash/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .assert() .code(101) - .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); assert!(!project_root.join("Cargo.toml").is_file()); } diff --git a/tests/testsuite/cargo_init/no_filename/mod.rs b/tests/testsuite/cargo_init/no_filename/mod.rs index 8edfd2823..aca139169 100644 --- a/tests/testsuite/cargo_init/no_filename/mod.rs +++ b/tests/testsuite/cargo_init/no_filename/mod.rs @@ -1,8 +1,7 @@ +use cargo_test_support::file; use cargo_test_support::paths; use cargo_test_support::prelude::*; -use cargo_test_support::curr_dir; - #[cfg(not(windows))] #[cargo_test] fn case() { @@ -11,6 +10,6 @@ fn case() { .current_dir(paths::root()) .assert() .code(101) - .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"]); } diff --git a/tests/testsuite/cargo_init/path_contains_separator/mod.rs b/tests/testsuite/cargo_init/path_contains_separator/mod.rs index 0a12f4269..7ec3707d5 100644 --- a/tests/testsuite/cargo_init/path_contains_separator/mod.rs +++ b/tests/testsuite/cargo_init/path_contains_separator/mod.rs @@ -1,12 +1,12 @@ 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::{t, 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().join("test:ing"); if !project_root.exists() { @@ -18,9 +18,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".gitignore").is_file()); } diff --git a/tests/testsuite/cargo_init/pijul_autodetect/mod.rs b/tests/testsuite/cargo_init/pijul_autodetect/mod.rs index d45ba868a..0a5ba570e 100644 --- a/tests/testsuite/cargo_init/pijul_autodetect/mod.rs +++ b/tests/testsuite/cargo_init/pijul_autodetect/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/reserved_name/mod.rs b/tests/testsuite/cargo_init/reserved_name/mod.rs index cc65fd0a1..2c9c54091 100644 --- a/tests/testsuite/cargo_init/reserved_name/mod.rs +++ b/tests/testsuite/cargo_init/reserved_name/mod.rs @@ -1,9 +1,8 @@ +use cargo_test_support::file; use cargo_test_support::paths; use cargo_test_support::prelude::*; use std::fs; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { let project_root = &paths::root().join("test"); @@ -14,8 +13,8 @@ fn case() { .current_dir(project_root) .assert() .code(101) - .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!(!project_root.join("Cargo.toml").is_file()); } diff --git a/tests/testsuite/cargo_init/simple_bin/mod.rs b/tests/testsuite/cargo_init/simple_bin/mod.rs index eaf0955f9..b9aabc8b5 100644 --- a/tests/testsuite/cargo_init/simple_bin/mod.rs +++ b/tests/testsuite/cargo_init/simple_bin/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,10 +14,10 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".gitignore").is_file()); snapbox::cmd::Command::cargo_ui() diff --git a/tests/testsuite/cargo_init/simple_git/mod.rs b/tests/testsuite/cargo_init/simple_git/mod.rs index c373fe2a2..177f640e8 100644 --- a/tests/testsuite/cargo_init/simple_git/mod.rs +++ b/tests/testsuite/cargo_init/simple_git/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/simple_git_ignore_exists/mod.rs b/tests/testsuite/cargo_init/simple_git_ignore_exists/mod.rs index 142e86efd..93320c284 100644 --- a/tests/testsuite/cargo_init/simple_git_ignore_exists/mod.rs +++ b/tests/testsuite/cargo_init/simple_git_ignore_exists/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,10 +14,10 @@ fn case() { .current_dir(project_root) .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); assert!(project_root.join(".git").is_dir()); snapbox::cmd::Command::cargo_ui() diff --git a/tests/testsuite/cargo_init/simple_hg/mod.rs b/tests/testsuite/cargo_init/simple_hg/mod.rs index 1d6765453..1d272737e 100644 --- a/tests/testsuite/cargo_init/simple_hg/mod.rs +++ b/tests/testsuite/cargo_init/simple_hg/mod.rs @@ -1,12 +1,12 @@ 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(requires_hg)] 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/simple_hg_ignore_exists/mod.rs b/tests/testsuite/cargo_init/simple_hg_ignore_exists/mod.rs index d45ba868a..0a5ba570e 100644 --- a/tests/testsuite/cargo_init/simple_hg_ignore_exists/mod.rs +++ b/tests/testsuite/cargo_init/simple_hg_ignore_exists/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,9 +14,9 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".git").is_dir()); } diff --git a/tests/testsuite/cargo_init/simple_lib/mod.rs b/tests/testsuite/cargo_init/simple_lib/mod.rs index d6bae5167..2f46c9356 100644 --- a/tests/testsuite/cargo_init/simple_lib/mod.rs +++ b/tests/testsuite/cargo_init/simple_lib/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,10 +14,10 @@ fn case() { .current_dir(project_root) .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); assert!(!project_root.join(".gitignore").is_file()); snapbox::cmd::Command::cargo_ui() diff --git a/tests/testsuite/cargo_init/unknown_flags/mod.rs b/tests/testsuite/cargo_init/unknown_flags/mod.rs index 4289b4b9e..4b61f9235 100644 --- a/tests/testsuite/cargo_init/unknown_flags/mod.rs +++ b/tests/testsuite/cargo_init/unknown_flags/mod.rs @@ -1,8 +1,7 @@ +use cargo_test_support::file; use cargo_test_support::paths; use cargo_test_support::prelude::*; -use cargo_test_support::curr_dir; - #[cargo_test] fn case() { snapbox::cmd::Command::cargo_ui() @@ -10,6 +9,6 @@ fn case() { .current_dir(paths::root()) .assert() .code(1) - .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"]); } diff --git a/tests/testsuite/cargo_init/with_argument/mod.rs b/tests/testsuite/cargo_init/with_argument/mod.rs index 0b5e342a1..54db7d293 100644 --- a/tests/testsuite/cargo_init/with_argument/mod.rs +++ b/tests/testsuite/cargo_init/with_argument/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root) .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); } diff --git a/tests/testsuite/cargo_init/workspace_add_member/mod.rs b/tests/testsuite/cargo_init/workspace_add_member/mod.rs index 87e2af0e5..6dc2885a2 100644 --- a/tests/testsuite/cargo_init/workspace_add_member/mod.rs +++ b/tests/testsuite/cargo_init/workspace_add_member/mod.rs @@ -1,12 +1,12 @@ 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(); snapbox::cmd::Command::cargo_ui() @@ -14,8 +14,8 @@ fn case() { .current_dir(project_root.join("crates").join("foo")) .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); } diff --git a/tests/testsuite/cargo_install/help/mod.rs b/tests/testsuite/cargo_install/help/mod.rs index a2c1c724b..9700da015 100644 --- a/tests/testsuite/cargo_install/help/mod.rs +++ b/tests/testsuite/cargo_install/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_locate_project/help/mod.rs b/tests/testsuite/cargo_locate_project/help/mod.rs index f6b7e8eaf..a1abcdb24 100644 --- a/tests/testsuite/cargo_locate_project/help/mod.rs +++ b/tests/testsuite/cargo_locate_project/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_login/help/mod.rs b/tests/testsuite/cargo_login/help/mod.rs index 86b95da15..d36f4551f 100644 --- a/tests/testsuite/cargo_login/help/mod.rs +++ b/tests/testsuite/cargo_login/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_logout/help/mod.rs b/tests/testsuite/cargo_logout/help/mod.rs index f895b60dd..a141c3c7d 100644 --- a/tests/testsuite/cargo_logout/help/mod.rs +++ b/tests/testsuite/cargo_logout/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_metadata/help/mod.rs b/tests/testsuite/cargo_metadata/help/mod.rs index a88c374fe..04d2e13a4 100644 --- a/tests/testsuite/cargo_metadata/help/mod.rs +++ b/tests/testsuite/cargo_metadata/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_new/add_members_to_non_workspace/mod.rs b/tests/testsuite/cargo_new/add_members_to_non_workspace/mod.rs index c70b97ca7..23ae2e31a 100644 --- a/tests/testsuite/cargo_new/add_members_to_non_workspace/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_non_workspace/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/mod.rs index 8bf91be45..c1d7ac485 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; let package_path = cwd.join("crates").join("foo"); @@ -16,8 +17,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_without_members/mod.rs b/tests/testsuite/cargo_new/add_members_to_workspace_without_members/mod.rs index c70b97ca7..23ae2e31a 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_without_members/mod.rs +++ b/tests/testsuite/cargo_new/add_members_to_workspace_without_members/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/empty_name/mod.rs b/tests/testsuite/cargo_new/empty_name/mod.rs index a7d56630f..73f4296e0 100644 --- a/tests/testsuite/cargo_new/empty_name/mod.rs +++ b/tests/testsuite/cargo_new/empty_name/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ fn case() { .current_dir(cwd) .assert() .failure() - .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); } diff --git a/tests/testsuite/cargo_new/help/mod.rs b/tests/testsuite/cargo_new/help/mod.rs index 6a1721deb..0804f3890 100644 --- a/tests/testsuite/cargo_new/help/mod.rs +++ b/tests/testsuite/cargo_new/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_new/inherit_workspace_lints/mod.rs b/tests/testsuite/cargo_new/inherit_workspace_lints/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_lints/mod.rs +++ b/tests/testsuite/cargo_new/inherit_workspace_lints/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/inherit_workspace_package_table/mod.rs b/tests/testsuite/cargo_new/inherit_workspace_package_table/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_package_table/mod.rs +++ b/tests/testsuite/cargo_new/inherit_workspace_package_table/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/mod.rs b/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/mod.rs index c3ac2d375..b5ac01fa7 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/mod.rs +++ b/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/inherit_workspace_package_table_with_registry/mod.rs b/tests/testsuite/cargo_new/inherit_workspace_package_table_with_registry/mod.rs index 16ec66ea2..85fbb21e7 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_package_table_with_registry/mod.rs +++ b/tests/testsuite/cargo_new/inherit_workspace_package_table_with_registry/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/inherit_workspace_package_table_without_version/mod.rs b/tests/testsuite/cargo_new/inherit_workspace_package_table_without_version/mod.rs index 9b9642468..4655b5f36 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_package_table_without_version/mod.rs +++ b/tests/testsuite/cargo_new/inherit_workspace_package_table_without_version/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/mod.rs b/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/mod.rs index 1634ece12..94508c7e6 100644 --- a/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/mod.rs +++ b/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/mod.rs @@ -1,11 +1,12 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -15,8 +16,8 @@ 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); } diff --git a/tests/testsuite/cargo_owner/help/mod.rs b/tests/testsuite/cargo_owner/help/mod.rs index 20583e5b1..69ff5c455 100644 --- a/tests/testsuite/cargo_owner/help/mod.rs +++ b/tests/testsuite/cargo_owner/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_package/help/mod.rs b/tests/testsuite/cargo_package/help/mod.rs index 4e2f28e4f..10d1730e3 100644 --- a/tests/testsuite/cargo_package/help/mod.rs +++ b/tests/testsuite/cargo_package/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_pkgid/help/mod.rs b/tests/testsuite/cargo_pkgid/help/mod.rs index 6d182d116..9dea28b56 100644 --- a/tests/testsuite/cargo_pkgid/help/mod.rs +++ b/tests/testsuite/cargo_pkgid/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_publish/help/mod.rs b/tests/testsuite/cargo_publish/help/mod.rs index 183b6aac4..57d090afa 100644 --- a/tests/testsuite/cargo_publish/help/mod.rs +++ b/tests/testsuite/cargo_publish/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_read_manifest/help/mod.rs b/tests/testsuite/cargo_read_manifest/help/mod.rs index d0055f6d8..ef18fa6b6 100644 --- a/tests/testsuite/cargo_read_manifest/help/mod.rs +++ b/tests/testsuite/cargo_read_manifest/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_remove/avoid_empty_tables/mod.rs b/tests/testsuite/cargo_remove/avoid_empty_tables/mod.rs index 17bc3f949..929332dd3 100644 --- a/tests/testsuite/cargo_remove/avoid_empty_tables/mod.rs +++ b/tests/testsuite/cargo_remove/avoid_empty_tables/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/build/mod.rs b/tests/testsuite/cargo_remove/build/mod.rs index 72ce478b9..fdde6f0d4 100644 --- a/tests/testsuite/cargo_remove/build/mod.rs +++ b/tests/testsuite/cargo_remove/build/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/dev/mod.rs b/tests/testsuite/cargo_remove/dev/mod.rs index d9cbdf1a7..bb3ff4e84 100644 --- a/tests/testsuite/cargo_remove/dev/mod.rs +++ b/tests/testsuite/cargo_remove/dev/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/dry_run/mod.rs b/tests/testsuite/cargo_remove/dry_run/mod.rs index 2e097135d..7b1ce0c3e 100644 --- a/tests/testsuite/cargo_remove/dry_run/mod.rs +++ b/tests/testsuite/cargo_remove/dry_run/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs b/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs index f66478c5d..007f314a1 100644 --- a/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs +++ b/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -11,7 +12,7 @@ fn case() { .dep("serde", "1.0.0") .publish(); - let project = Project::from_template(curr_dir!().join("in")); + let project = Project::from_template(current_dir!().join("in")); let project_root = project.root(); snapbox::cmd::Command::cargo_ui() @@ -20,8 +21,8 @@ fn case() { .args(["--package", "serde", "serde_derive"]) .assert() .code(0) - .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); } diff --git a/tests/testsuite/cargo_remove/gc_patch/mod.rs b/tests/testsuite/cargo_remove/gc_patch/mod.rs index d4d305323..4d68c216c 100644 --- a/tests/testsuite/cargo_remove/gc_patch/mod.rs +++ b/tests/testsuite/cargo_remove/gc_patch/mod.rs @@ -1,6 +1,7 @@ use cargo_test_support::basic_manifest; use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::git; use cargo_test_support::project; use cargo_test_support::CargoCommand; @@ -70,8 +71,8 @@ fn case() { .current_dir(&in_project.root()) .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"), &in_project.root()); + assert_ui().subset_matches(current_dir!().join("out"), &in_project.root()); } diff --git a/tests/testsuite/cargo_remove/gc_profile/mod.rs b/tests/testsuite/cargo_remove/gc_profile/mod.rs index 98b99bec3..c1c52b1c6 100644 --- a/tests/testsuite/cargo_remove/gc_profile/mod.rs +++ b/tests/testsuite/cargo_remove/gc_profile/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -19,7 +20,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -29,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/gc_replace/mod.rs b/tests/testsuite/cargo_remove/gc_replace/mod.rs index cbcf5bc07..2f44c7427 100644 --- a/tests/testsuite/cargo_remove/gc_replace/mod.rs +++ b/tests/testsuite/cargo_remove/gc_replace/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -19,7 +20,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -29,8 +30,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/help/mod.rs b/tests/testsuite/cargo_remove/help/mod.rs index 69fb60f03..6af5b4c3f 100644 --- a/tests/testsuite/cargo_remove/help/mod.rs +++ b/tests/testsuite/cargo_remove/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_remove/invalid_arg/mod.rs b/tests/testsuite/cargo_remove/invalid_arg/mod.rs index 97d5c8625..2f4427517 100644 --- a/tests/testsuite/cargo_remove/invalid_arg/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_arg/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_dep/mod.rs b/tests/testsuite/cargo_remove/invalid_dep/mod.rs index fb32a075f..93466218c 100644 --- a/tests/testsuite/cargo_remove/invalid_dep/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_dep/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_package/mod.rs b/tests/testsuite/cargo_remove/invalid_package/mod.rs index d7f84c035..9376500ef 100644 --- a/tests/testsuite/cargo_remove/invalid_package/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_package/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_package_multiple/mod.rs b/tests/testsuite/cargo_remove/invalid_package_multiple/mod.rs index d14179e0c..4f8cd3670 100644 --- a/tests/testsuite/cargo_remove/invalid_package_multiple/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_package_multiple/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_section/mod.rs b/tests/testsuite/cargo_remove/invalid_section/mod.rs index 94d475059..91bf47b7d 100644 --- a/tests/testsuite/cargo_remove/invalid_section/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_section/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_section_dep/mod.rs b/tests/testsuite/cargo_remove/invalid_section_dep/mod.rs index c20cd94d2..f7537a4ff 100644 --- a/tests/testsuite/cargo_remove/invalid_section_dep/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_section_dep/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_target/mod.rs b/tests/testsuite/cargo_remove/invalid_target/mod.rs index aba040a2b..7f1b1c113 100644 --- a/tests/testsuite/cargo_remove/invalid_target/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_target/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/invalid_target_dep/mod.rs b/tests/testsuite/cargo_remove/invalid_target_dep/mod.rs index f187e609c..bd0458329 100644 --- a/tests/testsuite/cargo_remove/invalid_target_dep/mod.rs +++ b/tests/testsuite/cargo_remove/invalid_target_dep/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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); } diff --git a/tests/testsuite/cargo_remove/multiple_deps/mod.rs b/tests/testsuite/cargo_remove/multiple_deps/mod.rs index d0af30a30..a897114df 100644 --- a/tests/testsuite/cargo_remove/multiple_deps/mod.rs +++ b/tests/testsuite/cargo_remove/multiple_deps/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/multiple_dev/mod.rs b/tests/testsuite/cargo_remove/multiple_dev/mod.rs index 7ec2bd0b7..17d658ba9 100644 --- a/tests/testsuite/cargo_remove/multiple_dev/mod.rs +++ b/tests/testsuite/cargo_remove/multiple_dev/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/no_arg/mod.rs b/tests/testsuite/cargo_remove/no_arg/mod.rs index f9e0e5548..794fa69c2 100644 --- a/tests/testsuite/cargo_remove/no_arg/mod.rs +++ b/tests/testsuite/cargo_remove/no_arg/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -27,8 +28,8 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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); } diff --git a/tests/testsuite/cargo_remove/offline/mod.rs b/tests/testsuite/cargo_remove/offline/mod.rs index e227eb095..a09fa1978 100644 --- a/tests/testsuite/cargo_remove/offline/mod.rs +++ b/tests/testsuite/cargo_remove/offline/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -35,8 +36,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/optional_dep_feature/mod.rs b/tests/testsuite/cargo_remove/optional_dep_feature/mod.rs index ce8fcf712..89999c973 100644 --- a/tests/testsuite/cargo_remove/optional_dep_feature/mod.rs +++ b/tests/testsuite/cargo_remove/optional_dep_feature/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs b/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs index 69406387b..ed024fbbe 100644 --- a/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs +++ b/tests/testsuite/cargo_remove/optional_dep_feature_formatting/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/optional_feature/mod.rs b/tests/testsuite/cargo_remove/optional_feature/mod.rs index 9ab3c4c24..45f1d7c61 100644 --- a/tests/testsuite/cargo_remove/optional_feature/mod.rs +++ b/tests/testsuite/cargo_remove/optional_feature/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/package/mod.rs b/tests/testsuite/cargo_remove/package/mod.rs index 73d01b89d..670453231 100644 --- a/tests/testsuite/cargo_remove/package/mod.rs +++ b/tests/testsuite/cargo_remove/package/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/remove_basic/mod.rs b/tests/testsuite/cargo_remove/remove_basic/mod.rs index 7c92026a5..886f24204 100644 --- a/tests/testsuite/cargo_remove/remove_basic/mod.rs +++ b/tests/testsuite/cargo_remove/remove_basic/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/skip_gc_glob_profile/mod.rs b/tests/testsuite/cargo_remove/skip_gc_glob_profile/mod.rs index 2d587455c..f8ea82a9f 100644 --- a/tests/testsuite/cargo_remove/skip_gc_glob_profile/mod.rs +++ b/tests/testsuite/cargo_remove/skip_gc_glob_profile/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -8,7 +9,7 @@ fn case() { cargo_test_support::registry::init(); cargo_test_support::registry::Package::new("toml", "0.1.1+my-package").publish(); - 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; @@ -18,8 +19,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/target/mod.rs b/tests/testsuite/cargo_remove/target/mod.rs index 6f6fc5c61..b9c966a1f 100644 --- a/tests/testsuite/cargo_remove/target/mod.rs +++ b/tests/testsuite/cargo_remove/target/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/target_build/mod.rs b/tests/testsuite/cargo_remove/target_build/mod.rs index 7adffa229..54beb798b 100644 --- a/tests/testsuite/cargo_remove/target_build/mod.rs +++ b/tests/testsuite/cargo_remove/target_build/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/target_dev/mod.rs b/tests/testsuite/cargo_remove/target_dev/mod.rs index 005eb7871..12a3a1028 100644 --- a/tests/testsuite/cargo_remove/target_dev/mod.rs +++ b/tests/testsuite/cargo_remove/target_dev/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -20,7 +21,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -30,8 +31,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/update_lock_file/mod.rs b/tests/testsuite/cargo_remove/update_lock_file/mod.rs index 00e7964e4..a589aa975 100644 --- a/tests/testsuite/cargo_remove/update_lock_file/mod.rs +++ b/tests/testsuite/cargo_remove/update_lock_file/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/workspace/mod.rs b/tests/testsuite/cargo_remove/workspace/mod.rs index 5274b07d7..cdc707e80 100644 --- a/tests/testsuite/cargo_remove/workspace/mod.rs +++ b/tests/testsuite/cargo_remove/workspace/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/workspace_non_virtual/mod.rs b/tests/testsuite/cargo_remove/workspace_non_virtual/mod.rs index 5274b07d7..cdc707e80 100644 --- a/tests/testsuite/cargo_remove/workspace_non_virtual/mod.rs +++ b/tests/testsuite/cargo_remove/workspace_non_virtual/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_remove/workspace_preserved/mod.rs b/tests/testsuite/cargo_remove/workspace_preserved/mod.rs index 5274b07d7..cdc707e80 100644 --- a/tests/testsuite/cargo_remove/workspace_preserved/mod.rs +++ b/tests/testsuite/cargo_remove/workspace_preserved/mod.rs @@ -1,5 +1,6 @@ use cargo_test_support::compare::assert_ui; -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; @@ -18,7 +19,7 @@ fn case() { .feature("std", &[]) .publish(); - 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; @@ -28,8 +29,8 @@ 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); } diff --git a/tests/testsuite/cargo_report/help/mod.rs b/tests/testsuite/cargo_report/help/mod.rs index 3d2975769..352216475 100644 --- a/tests/testsuite/cargo_report/help/mod.rs +++ b/tests/testsuite/cargo_report/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_run/help/mod.rs b/tests/testsuite/cargo_run/help/mod.rs index 0a8a6bde0..fc2db8257 100644 --- a/tests/testsuite/cargo_run/help/mod.rs +++ b/tests/testsuite/cargo_run/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_rustc/help/mod.rs b/tests/testsuite/cargo_rustc/help/mod.rs index 0a3b31686..9f95e5f10 100644 --- a/tests/testsuite/cargo_rustc/help/mod.rs +++ b/tests/testsuite/cargo_rustc/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_rustdoc/help/mod.rs b/tests/testsuite/cargo_rustdoc/help/mod.rs index 88652749f..bd6e2977e 100644 --- a/tests/testsuite/cargo_rustdoc/help/mod.rs +++ b/tests/testsuite/cargo_rustdoc/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_search/help/mod.rs b/tests/testsuite/cargo_search/help/mod.rs index b580816e7..f8f78c52b 100644 --- a/tests/testsuite/cargo_search/help/mod.rs +++ b/tests/testsuite/cargo_search/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_test/help/mod.rs b/tests/testsuite/cargo_test/help/mod.rs index ae5b092b7..1a3cdf4ce 100644 --- a/tests/testsuite/cargo_test/help/mod.rs +++ b/tests/testsuite/cargo_test/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_test/no_keep_going/mod.rs b/tests/testsuite/cargo_test/no_keep_going/mod.rs index fdec61642..17c65fa3d 100644 --- a/tests/testsuite/cargo_test/no_keep_going/mod.rs +++ b/tests/testsuite/cargo_test/no_keep_going/mod.rs @@ -1,10 +1,11 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::CargoCommand; use cargo_test_support::Project; #[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; @@ -14,6 +15,6 @@ fn case() { .current_dir(cwd) .assert() .code(1) - .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"]); } diff --git a/tests/testsuite/cargo_tree/help/mod.rs b/tests/testsuite/cargo_tree/help/mod.rs index 269ac2cdc..d67582e6a 100644 --- a/tests/testsuite/cargo_tree/help/mod.rs +++ b/tests/testsuite/cargo_tree/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_uninstall/help/mod.rs b/tests/testsuite/cargo_uninstall/help/mod.rs index 60c4faed0..b32a378aa 100644 --- a/tests/testsuite/cargo_uninstall/help/mod.rs +++ b/tests/testsuite/cargo_uninstall/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_update/help/mod.rs b/tests/testsuite/cargo_update/help/mod.rs index ae310977c..b3bc2146c 100644 --- a/tests/testsuite/cargo_update/help/mod.rs +++ b/tests/testsuite/cargo_update/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs b/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs index f1488b90d..f5e9d1f64 100644 --- a/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs +++ b/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs @@ -1,10 +1,11 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::current_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; use cargo_test_support::Project; #[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; @@ -14,6 +15,6 @@ fn case() { .current_dir(cwd) .assert() .code(101) - .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"]); } diff --git a/tests/testsuite/cargo_vendor/help/mod.rs b/tests/testsuite/cargo_vendor/help/mod.rs index c111b99c0..1b4b53501 100644 --- a/tests/testsuite/cargo_vendor/help/mod.rs +++ b/tests/testsuite/cargo_vendor/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_verify_project/help/mod.rs b/tests/testsuite/cargo_verify_project/help/mod.rs index 8f6c9bab1..b3f1ad689 100644 --- a/tests/testsuite/cargo_verify_project/help/mod.rs +++ b/tests/testsuite/cargo_verify_project/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_version/help/mod.rs b/tests/testsuite/cargo_version/help/mod.rs index daa8548c6..8520e0b0e 100644 --- a/tests/testsuite/cargo_version/help/mod.rs +++ b/tests/testsuite/cargo_version/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); } diff --git a/tests/testsuite/cargo_yank/help/mod.rs b/tests/testsuite/cargo_yank/help/mod.rs index 12034f152..9ea87f287 100644 --- a/tests/testsuite/cargo_yank/help/mod.rs +++ b/tests/testsuite/cargo_yank/help/mod.rs @@ -1,4 +1,4 @@ -use cargo_test_support::curr_dir; +use cargo_test_support::file; use cargo_test_support::prelude::*; #[cargo_test] @@ -8,6 +8,6 @@ fn case() { .arg("--help") .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"]); }