From eab2f9345378e5179f6631147b67d983f8064506 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 16 Feb 2024 10:26:03 -0600 Subject: [PATCH 1/2] test: Ensure snapbox works until CARGO_RUSTC_CURRENT_DIR is stabilized Snapbox's polyfill for `CARGO_RUSTC_CURRENT_DIR` looks for the furthest away `Cargo.toml`. That works in our repo but won't work as a submodule in rustc. This uses the `config.toml` hack for setting the variable. I verified - Without this, the polyfill is used - With this, it is used - Without this on nightly, the official `CARGO_RUSTC_CURRENT_DIR` is used --- .cargo/config.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 17d424a5d02..c4cd35e56bc 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,3 +2,8 @@ build-man = "run --package xtask-build-man --" stale-label = "run --package xtask-stale-label --" bump-check = "run --package xtask-bump-check --" + +[env] +# HACK: Until this is stabilized, `snapbox`s polyfill could get confused +# inside of the rust-lang/rust repo because it looks for the furthest-away `Cargo.toml` +CARGO_RUSTC_CURRENT_DIR = { value = "", relative = true } From 9f31f8c675bf86c498a9964a25fa61f6926ac988 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 14 Feb 2024 15:54:21 -0600 Subject: [PATCH 2/2] chore: Update snapbox --- Cargo.lock | 8 +++---- Cargo.toml | 2 +- crates/cargo-test-support/src/lib.rs | 21 ++----------------- crates/mdman/tests/compare.rs | 6 +++--- tests/testsuite/cargo/help/mod.rs | 6 +++--- tests/testsuite/cargo/z_help/mod.rs | 6 +++--- tests/testsuite/cargo_add/add_basic/mod.rs | 12 +++++------ tests/testsuite/cargo_add/add_multiple/mod.rs | 12 +++++------ .../add_normalized_name_external/mod.rs | 12 +++++------ .../testsuite/cargo_add/add_toolchain/mod.rs | 12 +++++------ tests/testsuite/cargo_add/build/mod.rs | 12 +++++------ .../build_prefer_existing_version/mod.rs | 14 ++++++------- .../cargo_add/change_rename_target/mod.rs | 12 +++++------ .../cargo_add/cyclic_features/mod.rs | 12 +++++------ .../cargo_add/default_features/mod.rs | 12 +++++------ .../deprecated_default_features/mod.rs | 12 +++++------ .../cargo_add/deprecated_section/mod.rs | 12 +++++------ .../cargo_add/detect_workspace_inherit/mod.rs | 12 +++++------ .../detect_workspace_inherit_features/mod.rs | 12 +++++------ .../detect_workspace_inherit_optional/mod.rs | 12 +++++------ .../detect_workspace_inherit_public/mod.rs | 12 +++++------ tests/testsuite/cargo_add/dev/mod.rs | 12 +++++------ .../cargo_add/dev_build_conflict/mod.rs | 12 +++++------ .../dev_prefer_existing_version/mod.rs | 12 +++++------ tests/testsuite/cargo_add/dry_run/mod.rs | 12 +++++------ .../testsuite/cargo_add/empty_dep_name/mod.rs | 12 +++++------ .../cargo_add/empty_dep_table/mod.rs | 12 +++++------ tests/testsuite/cargo_add/features/mod.rs | 12 +++++------ .../features_activated_over_limit/mod.rs | 12 +++++------ .../features_deactivated_over_limit/mod.rs | 12 +++++------ .../testsuite/cargo_add/features_empty/mod.rs | 12 +++++------ .../features_multiple_occurrences/mod.rs | 12 +++++------ .../cargo_add/features_preserve/mod.rs | 12 +++++------ .../cargo_add/features_spaced_values/mod.rs | 12 +++++------ .../cargo_add/features_unknown/mod.rs | 12 +++++------ .../features_unknown_no_features/mod.rs | 12 +++++------ tests/testsuite/cargo_add/git/mod.rs | 12 +++++------ tests/testsuite/cargo_add/git_branch/mod.rs | 12 +++++------ .../cargo_add/git_conflicts_namever/mod.rs | 12 +++++------ tests/testsuite/cargo_add/git_dev/mod.rs | 12 +++++------ .../cargo_add/git_inferred_name/mod.rs | 12 +++++------ .../git_inferred_name_multiple/mod.rs | 12 +++++------ .../cargo_add/git_multiple_names/mod.rs | 12 +++++------ .../git_multiple_packages_features/mod.rs | 12 +++++------ .../cargo_add/git_normalized_name/mod.rs | 12 +++++------ tests/testsuite/cargo_add/git_registry/mod.rs | 12 +++++------ tests/testsuite/cargo_add/git_rev/mod.rs | 12 +++++------ tests/testsuite/cargo_add/git_tag/mod.rs | 12 +++++------ tests/testsuite/cargo_add/help/mod.rs | 6 +++--- .../cargo_add/infer_prerelease/mod.rs | 12 +++++------ tests/testsuite/cargo_add/invalid_arg/mod.rs | 12 +++++------ .../cargo_add/invalid_git_name/mod.rs | 12 +++++------ .../invalid_key_inherit_dependency/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../cargo_add/invalid_manifest/mod.rs | 12 +++++------ .../cargo_add/invalid_name_external/mod.rs | 12 +++++------ tests/testsuite/cargo_add/invalid_path/mod.rs | 12 +++++------ .../cargo_add/invalid_path_name/mod.rs | 12 +++++------ .../cargo_add/invalid_path_self/mod.rs | 12 +++++------ .../cargo_add/invalid_target_empty/mod.rs | 12 +++++------ tests/testsuite/cargo_add/invalid_vers/mod.rs | 12 +++++------ .../testsuite/cargo_add/list_features/mod.rs | 12 +++++------ .../cargo_add/list_features_path/mod.rs | 12 +++++------ .../list_features_path_no_default/mod.rs | 12 +++++------ .../testsuite/cargo_add/locked_changed/mod.rs | 12 +++++------ .../cargo_add/locked_unchanged/mod.rs | 12 +++++------ .../cargo_add/lockfile_updated/mod.rs | 12 +++++------ .../cargo_add/manifest_path_package/mod.rs | 12 +++++------ .../cargo_add/merge_activated_features/mod.rs | 12 +++++------ .../multiple_conflicts_with_features/mod.rs | 12 +++++------ .../multiple_conflicts_with_rename/mod.rs | 12 +++++------ tests/testsuite/cargo_add/namever/mod.rs | 12 +++++------ tests/testsuite/cargo_add/no_args/mod.rs | 12 +++++------ .../cargo_add/no_default_features/mod.rs | 12 +++++------ tests/testsuite/cargo_add/no_optional/mod.rs | 12 +++++------ tests/testsuite/cargo_add/no_public/mod.rs | 12 +++++------ .../cargo_add/offline_empty_cache/mod.rs | 12 +++++------ tests/testsuite/cargo_add/optional/mod.rs | 12 +++++------ .../overwrite_default_features/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../cargo_add/overwrite_features/mod.rs | 12 +++++------ .../cargo_add/overwrite_git_with_path/mod.rs | 12 +++++------ .../overwrite_inherit_features_noop/mod.rs | 12 +++++------ .../cargo_add/overwrite_inherit_noop/mod.rs | 12 +++++------ .../overwrite_inherit_optional_noop/mod.rs | 12 +++++------ .../overwrite_inline_features/mod.rs | 12 +++++------ .../cargo_add/overwrite_name_dev_noop/mod.rs | 12 +++++------ .../cargo_add/overwrite_name_noop/mod.rs | 12 +++++------ .../overwrite_no_default_features/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../cargo_add/overwrite_no_optional/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../cargo_add/overwrite_no_public/mod.rs | 12 +++++------ .../overwrite_no_public_with_public/mod.rs | 12 +++++------ .../cargo_add/overwrite_optional/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../overwrite_optional_with_optional/mod.rs | 12 +++++------ .../cargo_add/overwrite_path_noop/mod.rs | 12 +++++------ .../overwrite_path_with_version/mod.rs | 12 +++++------ .../overwrite_preserves_inline_table/mod.rs | 12 +++++------ .../cargo_add/overwrite_public/mod.rs | 12 +++++------ .../overwrite_public_with_no_public/mod.rs | 12 +++++------ .../overwrite_rename_with_no_rename/mod.rs | 12 +++++------ .../overwrite_rename_with_rename/mod.rs | 12 +++++------ .../overwrite_rename_with_rename_noop/mod.rs | 12 +++++------ .../overwrite_version_with_git/mod.rs | 12 +++++------ .../overwrite_version_with_path/mod.rs | 12 +++++------ .../cargo_add/overwrite_with_rename/mod.rs | 12 +++++------ .../cargo_add/overwrite_workspace_dep/mod.rs | 12 +++++------ .../overwrite_workspace_dep_features/mod.rs | 12 +++++------ tests/testsuite/cargo_add/path/mod.rs | 12 +++++------ tests/testsuite/cargo_add/path_dev/mod.rs | 12 +++++------ .../cargo_add/path_inferred_name/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../cargo_add/path_normalized_name/mod.rs | 12 +++++------ .../cargo_add/preserve_dep_std_table/mod.rs | 12 +++++------ .../cargo_add/preserve_features_table/mod.rs | 12 +++++------ .../cargo_add/preserve_sorted/mod.rs | 12 +++++------ .../cargo_add/preserve_unsorted/mod.rs | 12 +++++------ tests/testsuite/cargo_add/public/mod.rs | 12 +++++------ tests/testsuite/cargo_add/quiet/mod.rs | 12 +++++------ tests/testsuite/cargo_add/registry/mod.rs | 12 +++++------ tests/testsuite/cargo_add/rename/mod.rs | 12 +++++------ tests/testsuite/cargo_add/require_weak/mod.rs | 12 +++++------ .../cargo_add/rust_version_ignore/mod.rs | 12 +++++------ .../rust_version_incompatible/mod.rs | 12 +++++------ .../cargo_add/rust_version_latest/mod.rs | 12 +++++------ .../cargo_add/rust_version_older/mod.rs | 12 +++++------ .../sorted_table_with_dotted_item/mod.rs | 12 +++++------ tests/testsuite/cargo_add/target/mod.rs | 12 +++++------ tests/testsuite/cargo_add/target_cfg/mod.rs | 12 +++++------ .../unknown_inherited_feature/mod.rs | 12 +++++------ tests/testsuite/cargo_add/vers/mod.rs | 12 +++++------ .../testsuite/cargo_add/workspace_name/mod.rs | 12 +++++------ .../testsuite/cargo_add/workspace_path/mod.rs | 12 +++++------ .../cargo_add/workspace_path_dev/mod.rs | 12 +++++------ tests/testsuite/cargo_bench/help/mod.rs | 6 +++--- .../cargo_bench/no_keep_going/mod.rs | 9 ++++---- tests/testsuite/cargo_build/help/mod.rs | 6 +++--- tests/testsuite/cargo_check/help/mod.rs | 6 +++--- tests/testsuite/cargo_clean/help/mod.rs | 6 +++--- tests/testsuite/cargo_config/help/mod.rs | 6 +++--- tests/testsuite/cargo_doc/help/mod.rs | 6 +++--- tests/testsuite/cargo_fetch/help/mod.rs | 6 +++--- tests/testsuite/cargo_fix/help/mod.rs | 6 +++--- .../cargo_generate_lockfile/help/mod.rs | 6 +++--- .../testsuite/cargo_git_checkout/help/mod.rs | 6 +++--- tests/testsuite/cargo_help/help/mod.rs | 6 +++--- tests/testsuite/cargo_init/auto_git/mod.rs | 12 +++++------ .../bin_already_exists_explicit/mod.rs | 12 +++++------ .../bin_already_exists_explicit_nosrc/mod.rs | 12 +++++------ .../bin_already_exists_implicit/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../bin_already_exists_implicit_nosrc/mod.rs | 12 +++++------ .../cargo_init/both_lib_and_bin/mod.rs | 7 +++---- .../mod.rs | 10 ++++----- .../confused_by_multiple_lib_files/mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../mod.rs | 12 +++++------ .../cargo_init/explicit_bin_with_git/mod.rs | 12 +++++------ .../cargo_init/formats_source/mod.rs | 12 +++++------ .../cargo_init/fossil_autodetect/mod.rs | 12 +++++------ .../cargo_init/git_autodetect/mod.rs | 10 ++++----- .../mod.rs | 12 +++++------ tests/testsuite/cargo_init/help/mod.rs | 6 +++--- .../ignores_failure_to_format_source/mod.rs | 12 +++++------ .../cargo_init/inferred_bin_with_git/mod.rs | 12 +++++------ .../cargo_init/inferred_lib_with_git/mod.rs | 12 +++++------ .../inherit_workspace_package_table/mod.rs | 11 +++++----- .../cargo_init/invalid_dir_name/mod.rs | 7 +++---- .../lib_already_exists_nosrc/mod.rs | 12 +++++------ .../cargo_init/lib_already_exists_src/mod.rs | 12 +++++------ .../cargo_init/mercurial_autodetect/mod.rs | 12 +++++------ .../multibin_project_name_clash/mod.rs | 12 +++++------ tests/testsuite/cargo_init/no_filename/mod.rs | 7 +++---- .../cargo_init/path_contains_separator/mod.rs | 12 +++++------ .../cargo_init/pijul_autodetect/mod.rs | 12 +++++------ .../testsuite/cargo_init/reserved_name/mod.rs | 7 +++---- tests/testsuite/cargo_init/simple_bin/mod.rs | 12 +++++------ tests/testsuite/cargo_init/simple_git/mod.rs | 12 +++++------ .../simple_git_ignore_exists/mod.rs | 12 +++++------ tests/testsuite/cargo_init/simple_hg/mod.rs | 12 +++++------ .../cargo_init/simple_hg_ignore_exists/mod.rs | 12 +++++------ tests/testsuite/cargo_init/simple_lib/mod.rs | 12 +++++------ .../testsuite/cargo_init/unknown_flags/mod.rs | 7 +++---- .../testsuite/cargo_init/with_argument/mod.rs | 12 +++++------ .../cargo_init/workspace_add_member/mod.rs | 12 +++++------ tests/testsuite/cargo_install/help/mod.rs | 6 +++--- .../cargo_locate_project/help/mod.rs | 6 +++--- tests/testsuite/cargo_login/help/mod.rs | 6 +++--- tests/testsuite/cargo_logout/help/mod.rs | 6 +++--- tests/testsuite/cargo_metadata/help/mod.rs | 6 +++--- .../add_members_to_non_workspace/mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- tests/testsuite/cargo_new/empty_name/mod.rs | 11 +++++----- tests/testsuite/cargo_new/help/mod.rs | 6 +++--- .../cargo_new/inherit_workspace_lints/mod.rs | 11 +++++----- .../inherit_workspace_package_table/mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- .../mod.rs | 11 +++++----- tests/testsuite/cargo_owner/help/mod.rs | 6 +++--- tests/testsuite/cargo_package/help/mod.rs | 6 +++--- tests/testsuite/cargo_pkgid/help/mod.rs | 6 +++--- tests/testsuite/cargo_publish/help/mod.rs | 6 +++--- .../testsuite/cargo_read_manifest/help/mod.rs | 6 +++--- .../cargo_remove/avoid_empty_tables/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/build/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/dev/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/dry_run/mod.rs | 11 +++++----- .../cargo_remove/gc_keep_used_patch/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/gc_patch/mod.rs | 9 ++++---- .../testsuite/cargo_remove/gc_profile/mod.rs | 11 +++++----- .../testsuite/cargo_remove/gc_replace/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/help/mod.rs | 6 +++--- .../testsuite/cargo_remove/invalid_arg/mod.rs | 11 +++++----- .../testsuite/cargo_remove/invalid_dep/mod.rs | 11 +++++----- .../cargo_remove/invalid_package/mod.rs | 11 +++++----- .../invalid_package_multiple/mod.rs | 11 +++++----- .../cargo_remove/invalid_section/mod.rs | 11 +++++----- .../cargo_remove/invalid_section_dep/mod.rs | 11 +++++----- .../cargo_remove/invalid_target/mod.rs | 11 +++++----- .../cargo_remove/invalid_target_dep/mod.rs | 11 +++++----- .../cargo_remove/multiple_deps/mod.rs | 11 +++++----- .../cargo_remove/multiple_dev/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/no_arg/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/offline/mod.rs | 11 +++++----- .../cargo_remove/optional_dep_feature/mod.rs | 11 +++++----- .../optional_dep_feature_formatting/mod.rs | 11 +++++----- .../cargo_remove/optional_feature/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/package/mod.rs | 11 +++++----- .../cargo_remove/remove_basic/mod.rs | 11 +++++----- .../cargo_remove/skip_gc_glob_profile/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/target/mod.rs | 11 +++++----- .../cargo_remove/target_build/mod.rs | 11 +++++----- .../testsuite/cargo_remove/target_dev/mod.rs | 11 +++++----- .../cargo_remove/update_lock_file/mod.rs | 11 +++++----- tests/testsuite/cargo_remove/workspace/mod.rs | 11 +++++----- .../cargo_remove/workspace_non_virtual/mod.rs | 11 +++++----- .../cargo_remove/workspace_preserved/mod.rs | 11 +++++----- tests/testsuite/cargo_report/help/mod.rs | 6 +++--- tests/testsuite/cargo_run/help/mod.rs | 6 +++--- tests/testsuite/cargo_rustc/help/mod.rs | 6 +++--- tests/testsuite/cargo_rustdoc/help/mod.rs | 6 +++--- tests/testsuite/cargo_search/help/mod.rs | 6 +++--- tests/testsuite/cargo_test/help/mod.rs | 6 +++--- .../testsuite/cargo_test/no_keep_going/mod.rs | 9 ++++---- tests/testsuite/cargo_tree/help/mod.rs | 6 +++--- tests/testsuite/cargo_uninstall/help/mod.rs | 6 +++--- tests/testsuite/cargo_update/help/mod.rs | 6 +++--- .../cargo_update/toolchain_pkgname/mod.rs | 9 ++++---- tests/testsuite/cargo_vendor/help/mod.rs | 6 +++--- .../cargo_verify_project/help/mod.rs | 6 +++--- tests/testsuite/cargo_version/help/mod.rs | 6 +++--- tests/testsuite/cargo_yank/help/mod.rs | 6 +++--- 265 files changed, 1435 insertions(+), 1407 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72b958c2688..80fdf1a89d4 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 0d4ea2dfdab..63b99dbc4f5 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 cbf793f0d0d..184f79916a6 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 fde2c235d36..661afcd9517 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 559377b278a..fcf53c95975 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 cca503d70d9..43afd385368 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 67cd948ae83..e7bf45e86b5 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 ce5e9b71d41..ffab903a6ce 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 ced39b99c22..c455e9d88b8 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 905b8c8a2de..3be555f37a4 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 001dd3a8f48..35ffd5674ff 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 285ec658a5f..25462d5ec91 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 d1540c8ad1d..d6705379aff 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 8b4c6123a5e..eeac50de51a 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 9d313b9d9fa..6994260abf6 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 c4fdd4f3e31..6baa89265ef 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 c4fdd4f3e31..6baa89265ef 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 2b9550ce0a3..60b454d3255 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 8067166dc9e..9cf13026cc5 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 423f1a26d43..faac9b7facd 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 680d4c4e3d0..d920ddada1e 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 c838f1eac41..7e1532a9b6e 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 70432b52961..f836e301569 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 2d3698c1473..e7a09805dfa 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 438ec7b73e0..8afffdc2acd 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 d7044ee1178..0c7dd0daa39 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 d612a07f7c8..f06d47cfb28 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 aebae9b3b4e..d3e485a561f 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 467e9a681c1..689245de3ba 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 b2ed6f87d86..287dce6674e 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 d58c6a292c0..a18e1062bcd 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 4189be7ea25..535944f2c7c 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 708fb4ddf13..d06571d37d2 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 4ee48311034..7b31b535d51 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 552319402f4..4f4dbc85a98 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 dff50a61f16..25a62208e96 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 507fb417d16..8a4a6deebb3 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 8235a7c3c08..7eb02246812 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 86b268b59f1..fc71c56a6d4 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 96be4f46ee5..767101c4743 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 4a3ded8c2f4..43069653765 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 a915f34723b..30254de726c 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 3ffe10714d4..61f8cc987b8 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 eb76b6f3450..fe14f67b56c 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 dbad201053d..f539f79866f 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 e44d71470b3..35c0d7b06b8 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 b8a669c7aed..ee380023949 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 706fc9ab7cf..c3f50467502 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 0962047f8ef..15f9a6a0458 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 f2b49376aaa..e36b8dd0b80 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 a4e4d268a25..45627df2184 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 2f407105d38..e9b888d3586 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 837293e5fe7..50acea2a655 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 837293e5fe7..50acea2a655 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 bee132560d0..a56d7b5fce1 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 4a2d01765f1..488f543d468 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 8cb9b512940..7fc0868f4c3 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 d8e6a34a6d3..0b3a5ec8d63 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 aec0880200f..264a3f1ee97 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 4bb32531bb6..627d46a6b55 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 43b3a4a798b..93448e86592 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 2ad903d1fff..abaa1b29aaa 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 0dbf824d0d0..be5d0a05f0e 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 e58de1c1d24..780c8485b58 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 0aa20873e38..2e179e5ad8f 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 5de047f57ce..7111027a477 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 613d8c863e5..dd76826583a 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 4e99a18ef87..b911d451cac 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 768cdb3a3cf..ae015d49aa5 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 161783282fd..45b6b359dcd 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 3cdad0e72f7..f818b1c68d0 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 9a94dcffa97..ad68456df1e 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 063072c798c..03c9ab4cc57 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 aca1e54228b..9a57b3c87d8 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 8a5d41c8d81..6824244e641 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 cc7e79b9761..042f1de9faa 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 912ac3fd3a7..b435df9deab 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 055b6a8a2ab..5fd1e56971f 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 8daaa961d79..4a9ede95cd8 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 9d313b9d9fa..6994260abf6 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 8a5d41c8d81..6824244e641 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 da55fced20e..6e6a258dee3 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 fd63cc70968..16999968639 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 2b9550ce0a3..60b454d3255 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 2b9550ce0a3..60b454d3255 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 2b9550ce0a3..60b454d3255 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 52ad6968a14..6ee3a244ab1 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 ea37368d5d2..934b249e836 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 120be4429b7..0de6b7d2f81 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 8a5d41c8d81..6824244e641 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 9d313b9d9fa..6994260abf6 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 cc7e79b9761..042f1de9faa 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 8daaa961d79..4a9ede95cd8 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 912ac3fd3a7..b435df9deab 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 bbf8d65a6e0..e95fceeeb63 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 8daaa961d79..4a9ede95cd8 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 511b31e29a0..820613c18f7 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 434124e938a..4f39b5613bf 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 fc057d8526b..147fb02c6b0 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 bb93cfa156b..769d5977423 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 da55fced20e..6e6a258dee3 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 bbf8d65a6e0..e95fceeeb63 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 912ac3fd3a7..b435df9deab 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 ea49a07c1d8..e643e817ac7 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 af96caef566..09edae3aa13 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 734d0b99ae8..35f27d38dca 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 fcf0aa5e6a2..91a4d3917dd 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 fd63cc70968..16999968639 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 49a0ae0ebbf..0c00a2d2b1c 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 15cfa571c3e..9be71d5ea67 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 15cfa571c3e..9be71d5ea67 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 fd63cc70968..16999968639 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 478e602a272..29c71d0fddd 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 fd63cc70968..16999968639 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 17c328ea60b..1313677a348 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 8ae8a4e7d22..22273d0fdee 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 1998fa7420e..d71529685e8 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 1998fa7420e..d71529685e8 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 aef0d3d2fe3..57cd63a329f 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 aef0d3d2fe3..57cd63a329f 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 bbf8d65a6e0..e95fceeeb63 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 1a02b0802a1..c570aabd8f7 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 d0d9378150a..c7693f13efa 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 28c92d7702a..754c078d036 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 1998fa7420e..d71529685e8 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 0404d12b4ba..198aecb7683 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 31fb577862d..5aa25e36d1f 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 7a42c566ebd..35247741c26 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 7a42c566ebd..35247741c26 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 46e8708a149..efa82f81e39 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 b47874949e7..23f0edfdc5a 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 0478ece7695..9846f58379b 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 8184dac8f0f..d0d2213ea03 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 ee7dab2d1e5..1f097d1b545 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 2ab0807debf..1e49edb57a4 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 fd63cc70968..16999968639 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 478e602a272..29c71d0fddd 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 9338664e5cb..104399937b2 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 6ed5f81f976..f996444d6d2 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 9ca23b478b5..d1271bf1f77 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 71571bc9586..32d87803fa8 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 7225292b80f..d4efe3c36aa 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 070238ef009..20bcef6832a 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 b0fd4f3e8f2..4fc28adbac1 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 79025bc32c1..b0f8349f095 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 2c67e155602..2a43ad544ba 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 0408ce06b7a..c22fb622f56 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 5ff877fbb24..a11c9787091 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 af445cda139..ef54d25b321 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 68c21752065..992fe1d122f 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 326bd218a6a..470f4b2de80 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 1f16fb659aa..43f5a419409 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 12349a09bdd..bcbb78be180 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 fe65940dbdc..8c6ae8acbea 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 d3e8e66df7c..d07cd385c2c 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 fe65940dbdc..8c6ae8acbea 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 c9232320a17..2be40317722 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 5e9e1b94c48..cc398155c15 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 d1cba2ff71f..62fd751d65d 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 326bd218a6a..470f4b2de80 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 326bd218a6a..470f4b2de80 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 59c192cb9ec..cd1d2046d33 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 7314e955c03..7c1efb243e8 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 ac1fb627154..5d2c72b157c 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 d45ba868ad5..0a5ba570e5b 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 aef47bc7db8..ae6963aba6c 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 cd4437c6537..3522534caba 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 7f00d347a62..58febefe8a8 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 fd9394049fc..b2b927a4e33 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 80bec8893cc..619045a0c6b 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 80bec8893cc..619045a0c6b 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 4e1dda845cb..3132705f3bd 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 2b1be9022b0..52f96cf35cc 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 d3e8e66df7c..d07cd385c2c 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 d3e8e66df7c..d07cd385c2c 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 d45ba868ad5..0a5ba570e5b 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 fdd4476d93b..5f2693e3f45 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 8edfd282316..aca139169f9 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 0a12f4269d2..7ec3707d5e2 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 d45ba868ad5..0a5ba570e5b 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 cc65fd0a183..2c9c5409177 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 eaf0955f9f8..b9aabc8b586 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 c373fe2a2c6..177f640e8f9 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 142e86efdc0..93320c284eb 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 1d676545304..1d272737e21 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 d45ba868ad5..0a5ba570e5b 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 d6bae51672a..2f46c9356e6 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 4289b4b9ec9..4b61f9235ad 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 0b5e342a138..54db7d293f2 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 87e2af0e50f..6dc2885a20f 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 a2c1c724b59..9700da015d6 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 f6b7e8eafd2..a1abcdb241d 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 86b95da155c..d36f4551ff8 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 f895b60dd3f..a141c3c7de7 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 a88c374fedb..04d2e13a422 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 c70b97ca723..23ae2e31a58 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 9b964246846..4655b5f365a 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 9b964246846..4655b5f365a 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 8bf91be454c..c1d7ac48530 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 9b964246846..4655b5f365a 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 9b964246846..4655b5f365a 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 9b964246846..4655b5f365a 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 c70b97ca723..23ae2e31a58 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 a7d56630fb5..73f4296e02e 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 6a1721deb79..0804f38909f 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 9b964246846..4655b5f365a 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 9b964246846..4655b5f365a 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 c3ac2d37527..b5ac01fa7a4 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 16ec66ea216..85fbb21e7b7 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 9b964246846..4655b5f365a 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 1634ece12fb..94508c7e6f5 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 20583e5b1bc..69ff5c45575 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 4e2f28e4fc7..10d1730e396 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 6d182d11657..9dea28b56f4 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 183b6aac493..57d090afa0c 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 d0055f6d8d2..ef18fa6b6c0 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 17bc3f949e1..929332dd3e7 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 72ce478b904..fdde6f0d4bd 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 d9cbdf1a7e0..bb3ff4e84cf 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 2e097135def..7b1ce0c3eb8 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 f66478c5d0e..007f314a10a 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 d4d305323bc..4d68c216c78 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 98b99bec34c..c1c52b1c612 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 cbcf5bc07a3..2f44c7427d7 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 69fb60f038e..6af5b4c3fad 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 97d5c8625cd..2f442751720 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 fb32a075f14..93466218c04 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 d7f84c035eb..9376500ef89 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 d14179e0cc4..4f8cd367053 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 94d4750590d..91bf47b7de8 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 c20cd94d2ff..f7537a4ffc9 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 aba040a2b00..7f1b1c1138a 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 f187e609c33..bd045832940 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 d0af30a3016..a897114df55 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 7ec2bd0b77b..17d658ba9bb 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 f9e0e554824..794fa69c2e2 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 e227eb0956c..a09fa197890 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 ce8fcf71227..89999c97351 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 69406387b81..ed024fbbeaf 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 9ab3c4c24a1..45f1d7c6124 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 73d01b89dba..6704532315b 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 7c92026a5e6..886f24204ba 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 2d587455c5a..f8ea82a9f94 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 6f6fc5c6116..b9c966a1f41 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 7adffa22922..54beb798b36 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 005eb78716b..12a3a10286b 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 00e7964e45c..a589aa9759b 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 5274b07d7a1..cdc707e8069 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 5274b07d7a1..cdc707e8069 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 5274b07d7a1..cdc707e8069 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 3d29757694b..3522164751b 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 0a8a6bde076..fc2db82578f 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 0a3b3168642..9f95e5f102e 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 88652749f9c..bd6e2977eaf 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 b580816e722..f8f78c52b53 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 ae5b092b774..1a3cdf4ce47 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 fdec6164235..17c65fa3da5 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 269ac2cdc31..d67582e6a15 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 60c4faed0c8..b32a378aa39 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 ae310977c45..b3bc2146c89 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 f1488b90d16..f5e9d1f640c 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 c111b99c0f7..1b4b53501c9 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 8f6c9bab141..b3f1ad689af 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 daa8548c67d..8520e0b0ec4 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 12034f1524f..9ea87f287b0 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"]); }