diff --git a/tests/testsuite/registry.rs b/tests/testsuite/registry.rs index 73a77368016d..169c0974ac98 100644 --- a/tests/testsuite/registry.rs +++ b/tests/testsuite/registry.rs @@ -1,14 +1,13 @@ //! Tests for normal registry dependencies. -#![allow(deprecated)] - use cargo::core::SourceId; use cargo_test_support::cargo_process; use cargo_test_support::paths::{self, CargoPathExt}; +use cargo_test_support::prelude::*; use cargo_test_support::registry::{ self, registry_path, Dependency, Package, RegistryBuilder, Response, TestRegistry, }; -use cargo_test_support::{basic_manifest, project}; +use cargo_test_support::{basic_manifest, project, str}; use cargo_test_support::{git, install::cargo_home, t}; use cargo_util::paths::remove_dir_all; use std::fmt::Write; @@ -30,15 +29,15 @@ fn test_server_stops() { #[cargo_test] fn simple_http() { let _server = setup_http(); - simple(); + simple(true); } #[cargo_test] fn simple_git() { - simple(); + simple(false); } -fn simple() { +fn simple(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -58,48 +57,66 @@ fn simple() { Package::new("bar", "0.0.1").publish(); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); p.cargo("clean").run(); assert!(paths::home().join(".cargo/registry/CACHEDIR.TAG").is_file()); - // Don't download a second time - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + // Don't download a second time + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn deps_http() { let _server = setup_http(); - deps(); + deps(true); } #[cargo_test] fn deps_git() { - deps(); + deps(false); } -fn deps() { +fn deps(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -120,21 +137,34 @@ fn deps() { Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dep("baz", "*").publish(); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 3 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) [CHECKING] baz v0.0.1 [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 3 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); assert!(paths::home().join(".cargo/registry/CACHEDIR.TAG").is_file()); } @@ -142,15 +172,15 @@ fn deps() { #[cargo_test] fn nonexistent_http() { let _server = setup_http(); - nonexistent(); + nonexistent(true); } #[cargo_test] fn nonexistent_git() { - nonexistent(); + nonexistent(false); } -fn nonexistent() { +fn nonexistent(is_http: bool) { Package::new("init", "0.0.1").publish(); let p = project() @@ -170,31 +200,41 @@ fn nonexistent() { .file("src/main.rs", "fn main() {}") .build(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `nonexistent` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `nonexistent` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + }; p.cargo("check") .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] index -error: no matching package named `nonexistent` found -location searched: registry [..] -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); } #[cargo_test] fn wrong_case_http() { let _server = setup_http(); - wrong_case(); + wrong_case(true); } #[cargo_test] fn wrong_case_git() { - wrong_case(); + wrong_case(false); } -fn wrong_case() { +fn wrong_case(is_http: bool) { Package::new("init", "0.0.1").publish(); let p = project() @@ -214,34 +254,46 @@ fn wrong_case() { .file("src/main.rs", "fn main() {}") .build(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package found +searched package name: `Init` +perhaps you meant: init +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package found +searched package name: `Init` +perhaps you meant: init +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + }; // #5678 to make this work p.cargo("check") .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] index -error: no matching package found -searched package name: `Init` -perhaps you meant: init -location searched: registry [..] -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); } #[cargo_test] fn mis_hyphenated_http() { let _server = setup_http(); - mis_hyphenated(); + mis_hyphenated(true); } #[cargo_test] fn mis_hyphenated_git() { - mis_hyphenated(); + mis_hyphenated(false); } -fn mis_hyphenated() { +fn mis_hyphenated(is_http: bool) { Package::new("mis-hyphenated", "0.0.1").publish(); let p = project() @@ -261,34 +313,46 @@ fn mis_hyphenated() { .file("src/main.rs", "fn main() {}") .build(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package found +searched package name: `mis_hyphenated` +perhaps you meant: mis-hyphenated +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package found +searched package name: `mis_hyphenated` +perhaps you meant: mis-hyphenated +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + }; // #2775 to make this work p.cargo("check") .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] index -error: no matching package found -searched package name: `mis_hyphenated` -perhaps you meant: mis-hyphenated -location searched: registry [..] -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); } #[cargo_test] fn wrong_version_http() { let _server = setup_http(); - wrong_version(); + wrong_version(true); } #[cargo_test] fn wrong_version_git() { - wrong_version(); + wrong_version(false); } -fn wrong_version() { +fn wrong_version(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -309,46 +373,74 @@ fn wrong_version() { Package::new("foo", "0.0.1").publish(); Package::new("foo", "0.0.2").publish(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to select a version for the requirement `foo = ">=1.0.0"` +candidate versions found which didn't match: 0.0.2, 0.0.1 +location searched: `dummy-registry` index (which is replacing registry `crates-io`) +required by package `foo v0.0.1 ([ROOT]/foo)` +perhaps a crate was updated and forgotten to be re-vendored? + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to select a version for the requirement `foo = ">=1.0.0"` +candidate versions found which didn't match: 0.0.2, 0.0.1 +location searched: `dummy-registry` index (which is replacing registry `crates-io`) +required by package `foo v0.0.1 ([ROOT]/foo)` +perhaps a crate was updated and forgotten to be re-vendored? + +"#]] + }; p.cargo("check") .with_status(101) - .with_stderr_contains( - "\ -error: failed to select a version for the requirement `foo = \">=1.0.0\"` -candidate versions found which didn't match: 0.0.2, 0.0.1 -location searched: `[..]` index (which is replacing registry `[..]`) -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); Package::new("foo", "0.0.3").publish(); Package::new("foo", "0.0.4").publish(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to select a version for the requirement `foo = ">=1.0.0"` +candidate versions found which didn't match: 0.0.4, 0.0.3, 0.0.2, ... +location searched: `dummy-registry` index (which is replacing registry `crates-io`) +required by package `foo v0.0.1 ([ROOT]/foo)` +perhaps a crate was updated and forgotten to be re-vendored? + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to select a version for the requirement `foo = ">=1.0.0"` +candidate versions found which didn't match: 0.0.4, 0.0.3, 0.0.2, ... +location searched: `dummy-registry` index (which is replacing registry `crates-io`) +required by package `foo v0.0.1 ([ROOT]/foo)` +perhaps a crate was updated and forgotten to be re-vendored? + +"#]] + }; p.cargo("check") .with_status(101) - .with_stderr_contains( - "\ -error: failed to select a version for the requirement `foo = \">=1.0.0\"` -candidate versions found which didn't match: 0.0.4, 0.0.3, 0.0.2, ... -location searched: `[..]` index (which is replacing registry `[..]`) -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); } #[cargo_test] fn bad_cksum_http() { let _server = setup_http(); - bad_cksum(); + bad_cksum(true); } #[cargo_test] fn bad_cksum_git() { - bad_cksum(); + bad_cksum(false); } -fn bad_cksum() { +fn bad_cksum(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -370,35 +462,49 @@ fn bad_cksum() { pkg.publish(); t!(File::create(&pkg.archive_dst())); - p.cargo("check -v") - .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] bad-cksum [..] +[DOWNLOADED] bad-cksum v0.0.1 (registry `dummy-registry`) [ERROR] failed to download replaced source registry `crates-io` Caused by: failed to verify the checksum of `bad-cksum v0.0.1 (registry `dummy-registry`)` -", - ) + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] bad-cksum v0.0.1 (registry `dummy-registry`) +[ERROR] failed to download replaced source registry `crates-io` + +Caused by: + failed to verify the checksum of `bad-cksum v0.0.1 (registry `dummy-registry`)` + +"#]] + }; + p.cargo("check -v") + .with_status(101) + .with_stderr_data(expected) .run(); } #[cargo_test] fn update_registry_http() { let _server = setup_http(); - update_registry(); + update_registry(true); } #[cargo_test] fn update_registry_git() { - update_registry(); + update_registry(false); } -fn update_registry() { +fn update_registry(is_http: bool) { Package::new("init", "0.0.1").publish(); let p = project() @@ -418,46 +524,68 @@ fn update_registry() { .file("src/main.rs", "fn main() {}") .build(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `notyet` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `notyet` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + }; p.cargo("check") .with_status(101) - .with_stderr_contains( - "\ -error: no matching package named `notyet` found -location searched: registry `[..]` -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); Package::new("notyet", "0.0.1").publish(); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] notyet v0.0.1 (registry `dummy-registry`) [CHECKING] notyet v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] notyet v0.0.1 (registry `dummy-registry`) +[CHECKING] notyet v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn package_with_path_deps_http() { let _server = setup_http(); - package_with_path_deps(); + package_with_path_deps(true); } #[cargo_test] fn package_with_path_deps_git() { - package_with_path_deps(); + package_with_path_deps(false); } -fn package_with_path_deps() { +fn package_with_path_deps(is_http: bool) { Package::new("init", "0.0.1").publish(); let p = project() @@ -483,53 +611,80 @@ fn package_with_path_deps() { .file("notyet/src/lib.rs", "") .build(); - p.cargo("package") - .with_status(101) - .with_stderr_contains( - "\ -[PACKAGING] foo [..] -[UPDATING] [..] + let expected = if is_http { + str![[r#" +[PACKAGING] foo v0.0.1 ([ROOT]/foo) +[UPDATING] `dummy-registry` index [ERROR] failed to prepare local package for uploading Caused by: no matching package named `notyet` found location searched: registry `crates-io` - required by package `foo v0.0.1 [..]` -", - ) + required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[PACKAGING] foo v0.0.1 ([ROOT]/foo) +[UPDATING] `dummy-registry` index +[ERROR] failed to prepare local package for uploading + +Caused by: + no matching package named `notyet` found + location searched: registry `crates-io` + required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + }; + p.cargo("package") + .with_status(101) + .with_stderr_data(expected) .run(); Package::new("notyet", "0.0.1").publish(); - p.cargo("package") - .with_stderr( - "\ -[PACKAGING] foo v0.0.1 ([CWD]) -[UPDATING] `[..]` index -[PACKAGED] [..] -[VERIFYING] foo v0.0.1 ([CWD]) + let expected = if is_http { + str![[r#" +[PACKAGING] foo v0.0.1 ([ROOT]/foo) +[UPDATING] `dummy-registry` index +[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed) +[VERIFYING] foo v0.0.1 ([ROOT]/foo) [DOWNLOADING] crates ... [DOWNLOADED] notyet v0.0.1 (registry `dummy-registry`) [COMPILING] notyet v0.0.1 -[COMPILING] foo v0.0.1 ([CWD][..]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[COMPILING] foo v0.0.1 ([ROOT]/foo/target/package/foo-0.0.1) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[PACKAGING] foo v0.0.1 ([ROOT]/foo) +[UPDATING] `dummy-registry` index +[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed) +[VERIFYING] foo v0.0.1 ([ROOT]/foo) +[DOWNLOADING] crates ... +[DOWNLOADED] notyet v0.0.1 (registry `dummy-registry`) +[COMPILING] notyet v0.0.1 +[COMPILING] foo v0.0.1 ([ROOT]/foo/target/package/foo-0.0.1) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("package").with_stderr_data(expected).run(); } #[cargo_test] fn lockfile_locks_http() { let _server = setup_http(); - lockfile_locks(); + lockfile_locks(true); } #[cargo_test] fn lockfile_locks_git() { - lockfile_locks(); + lockfile_locks(false); } -fn lockfile_locks() { +fn lockfile_locks(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -549,38 +704,60 @@ fn lockfile_locks() { Package::new("bar", "0.0.1").publish(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); p.root().move_into_the_past(); Package::new("bar", "0.0.2").publish(); - p.cargo("check").with_stderr("[FINISHED] [..]").run(); + let expected = if is_http { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn lockfile_locks_transitively_http() { let _server = setup_http(); - lockfile_locks_transitively(); + lockfile_locks_transitively(true); } #[cargo_test] fn lockfile_locks_transitively_git() { - lockfile_locks_transitively(); + lockfile_locks_transitively(false); } -fn lockfile_locks_transitively() { +fn lockfile_locks_transitively(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -601,41 +778,65 @@ fn lockfile_locks_transitively() { Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dep("baz", "*").publish(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 3 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) [CHECKING] baz v0.0.1 [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 3 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); p.root().move_into_the_past(); Package::new("baz", "0.0.2").publish(); Package::new("bar", "0.0.2").dep("baz", "*").publish(); - p.cargo("check").with_stderr("[FINISHED] [..]").run(); + let expected = if is_http { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn yanks_are_not_used_http() { let _server = setup_http(); - yanks_are_not_used(); + yanks_are_not_used(true); } #[cargo_test] fn yanks_are_not_used_git() { - yanks_are_not_used(); + yanks_are_not_used(false); } -fn yanks_are_not_used() { +fn yanks_are_not_used(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -661,35 +862,48 @@ fn yanks_are_not_used() { .yanked(true) .publish(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 3 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) [CHECKING] baz v0.0.1 [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 3 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn relying_on_a_yank_is_bad_http() { let _server = setup_http(); - relying_on_a_yank_is_bad(); + relying_on_a_yank_is_bad(true); } #[cargo_test] fn relying_on_a_yank_is_bad_git() { - relying_on_a_yank_is_bad(); + relying_on_a_yank_is_bad(false); } -fn relying_on_a_yank_is_bad() { +fn relying_on_a_yank_is_bad(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -711,32 +925,47 @@ fn relying_on_a_yank_is_bad() { Package::new("baz", "0.0.2").yanked(true).publish(); Package::new("bar", "0.0.1").dep("baz", "=0.0.2").publish(); - p.cargo("check") - .with_status(101) - .with_stderr_contains( - "\ -error: failed to select a version for the requirement `baz = \"=0.0.2\"` + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to select a version for the requirement `baz = "=0.0.2"` candidate versions found which didn't match: 0.0.1 -location searched: `[..]` index (which is replacing registry `[..]`) +location searched: `dummy-registry` index (which is replacing registry `crates-io`) required by package `bar v0.0.1` - ... which satisfies dependency `bar = \"*\"` of package `foo [..]` -", - ) + ... which satisfies dependency `bar = "*"` of package `foo v0.0.1 ([ROOT]/foo)` +perhaps a crate was updated and forgotten to be re-vendored? + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to select a version for the requirement `baz = "=0.0.2"` +candidate versions found which didn't match: 0.0.1 +location searched: `dummy-registry` index (which is replacing registry `crates-io`) +required by package `bar v0.0.1` + ... which satisfies dependency `bar = "*"` of package `foo v0.0.1 ([ROOT]/foo)` +perhaps a crate was updated and forgotten to be re-vendored? + +"#]] + }; + p.cargo("check") + .with_status(101) + .with_stderr_data(expected) .run(); } #[cargo_test] fn yanks_in_lockfiles_are_ok_http() { let _server = setup_http(); - yanks_in_lockfiles_are_ok(); + yanks_in_lockfiles_are_ok(true); } #[cargo_test] fn yanks_in_lockfiles_are_ok_git() { - yanks_in_lockfiles_are_ok(); + yanks_in_lockfiles_are_ok(false); } -fn yanks_in_lockfiles_are_ok() { +fn yanks_in_lockfiles_are_ok(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -762,32 +991,54 @@ fn yanks_in_lockfiles_are_ok() { Package::new("bar", "0.0.1").yanked(true).publish(); - p.cargo("check").with_stderr("[FINISHED] [..]").run(); + let expected = if is_http { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); + + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `bar` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `bar` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` +"#]] + }; p.cargo("update") .with_status(101) - .with_stderr_contains( - "\ -error: no matching package named `bar` found -location searched: registry [..] -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); } #[cargo_test] fn yanks_in_lockfiles_are_ok_for_other_update_http() { let _server = setup_http(); - yanks_in_lockfiles_are_ok_for_other_update(); + yanks_in_lockfiles_are_ok_for_other_update(true); } #[cargo_test] fn yanks_in_lockfiles_are_ok_for_other_update_git() { - yanks_in_lockfiles_are_ok_for_other_update(); + yanks_in_lockfiles_are_ok_for_other_update(false); } -fn yanks_in_lockfiles_are_ok_for_other_update() { +fn yanks_in_lockfiles_are_ok_for_other_update(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -816,44 +1067,73 @@ fn yanks_in_lockfiles_are_ok_for_other_update() { Package::new("bar", "0.0.1").yanked(true).publish(); Package::new("baz", "0.0.1").publish(); - p.cargo("check").with_stderr("[FINISHED] [..]").run(); + let expected = if is_http { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); Package::new("baz", "0.0.2").publish(); + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `bar` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] no matching package named `bar` found +location searched: registry `crates-io` +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]] + }; p.cargo("update") .with_status(101) - .with_stderr_contains( - "\ -error: no matching package named `bar` found -location searched: registry [..] -required by package `foo v0.0.1 ([..])` -", - ) + .with_stderr_data(expected) .run(); - p.cargo("update baz") - .with_stderr_contains( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [UPDATING] baz v0.0.1 -> v0.0.2 -", - ) - .run(); + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[UPDATING] baz v0.0.1 -> v0.0.2 + +"#]] + }; + p.cargo("update baz").with_stderr_data(expected).run(); } #[cargo_test] fn yanks_in_lockfiles_are_ok_with_new_dep_http() { let _server = setup_http(); - yanks_in_lockfiles_are_ok_with_new_dep(); + yanks_in_lockfiles_are_ok_with_new_dep(true); } #[cargo_test] fn yanks_in_lockfiles_are_ok_with_new_dep_git() { - yanks_in_lockfiles_are_ok_with_new_dep(); + yanks_in_lockfiles_are_ok_with_new_dep(false); } -fn yanks_in_lockfiles_are_ok_with_new_dep() { +fn yanks_in_lockfiles_are_ok_with_new_dep(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -895,34 +1175,46 @@ fn yanks_in_lockfiles_are_ok_with_new_dep() { "#, ); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [ADDING] baz v0.0.1 [DOWNLOADING] crates ... [DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) [CHECKING] baz v0.0.1 -[CHECKING] foo v0.0.1 [..] -[FINISHED] [..] -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[ADDING] baz v0.0.1 +[DOWNLOADING] crates ... +[DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) +[CHECKING] baz v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn update_with_lockfile_if_packages_missing_http() { let _server = setup_http(); - update_with_lockfile_if_packages_missing(); + update_with_lockfile_if_packages_missing(true); } #[cargo_test] fn update_with_lockfile_if_packages_missing_git() { - update_with_lockfile_if_packages_missing(); + update_with_lockfile_if_packages_missing(false); } -fn update_with_lockfile_if_packages_missing() { +fn update_with_lockfile_if_packages_missing(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -944,31 +1236,39 @@ fn update_with_lockfile_if_packages_missing() { p.cargo("check").run(); p.root().move_into_the_past(); - paths::home().join(".cargo/registry").rm_rf(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + paths::home().join(".cargo/registry").rm_rf(); + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn update_lockfile_http() { let _server = setup_http(); - update_lockfile(); + update_lockfile(true); } #[cargo_test] fn update_lockfile_git() { - update_lockfile(); + update_lockfile(false); } -fn update_lockfile() { +fn update_lockfile(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -994,92 +1294,141 @@ fn update_lockfile() { Package::new("bar", "0.0.3").publish(); paths::home().join(".cargo/registry").rm_rf(); println!("0.0.2 update"); - p.cargo("update bar --precise 0.0.2") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [UPDATING] bar v0.0.1 -> v0.0.2 -", - ) + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[UPDATING] bar v0.0.1 -> v0.0.2 + +"#]] + }; + p.cargo("update bar --precise 0.0.2") + .with_stderr_data(expected) .run(); println!("0.0.2 build"); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.2 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.2 (registry `dummy-registry`) [CHECKING] bar v0.0.2 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.2 (registry `dummy-registry`) +[CHECKING] bar v0.0.2 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); println!("0.0.3 update"); - p.cargo("update bar") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[UPDATING] bar v0.0.2 -> v0.0.3 + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [UPDATING] bar v0.0.2 -> v0.0.3 -", - ) - .run(); + +"#]] + }; + p.cargo("update bar").with_stderr_data(expected).run(); println!("0.0.3 build"); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.3 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.3 (registry `dummy-registry`) [CHECKING] bar v0.0.3 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.3 (registry `dummy-registry`) +[CHECKING] bar v0.0.3 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); println!("new dependencies update"); Package::new("bar", "0.0.4").dep("spam", "0.2.5").publish(); Package::new("spam", "0.2.5").publish(); - p.cargo("update bar") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [UPDATING] bar v0.0.3 -> v0.0.4 [ADDING] spam v0.2.5 -", - ) - .run(); + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[UPDATING] bar v0.0.3 -> v0.0.4 +[ADDING] spam v0.2.5 + +"#]] + }; + p.cargo("update bar").with_stderr_data(expected).run(); println!("new dependencies update"); Package::new("bar", "0.0.5").publish(); - p.cargo("update bar") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [UPDATING] bar v0.0.4 -> v0.0.5 [REMOVING] spam v0.2.5 -", - ) - .run(); + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[UPDATING] bar v0.0.4 -> v0.0.5 +[REMOVING] spam v0.2.5 + +"#]] + }; + p.cargo("update bar").with_stderr_data(expected).run(); } #[cargo_test] fn dev_dependency_not_used_http() { let _server = setup_http(); - dev_dependency_not_used(); + dev_dependency_not_used(true); } #[cargo_test] fn dev_dependency_not_used_git() { - dev_dependency_not_used(); + dev_dependency_not_used(false); } -fn dev_dependency_not_used() { +fn dev_dependency_not_used(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1100,34 +1449,45 @@ fn dev_dependency_not_used() { Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dev_dep("baz", "*").publish(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn bad_license_file_http() { let registry = setup_http(); - bad_license_file(®istry); + bad_license_file(®istry, true); } #[cargo_test] fn bad_license_file_git() { let registry = registry::init(); - bad_license_file(®istry); + bad_license_file(®istry, false); } -fn bad_license_file(registry: &TestRegistry) { +fn bad_license_file(registry: &TestRegistry, is_http: bool) { Package::new("foo", "1.0.0").publish(); let p = project() .file( @@ -1145,25 +1505,44 @@ fn bad_license_file(registry: &TestRegistry) { ) .file("src/main.rs", "fn main() {}") .build(); + let expected = if is_http { + str![[r#" +[UPDATING] crates.io index +[CREDENTIAL] cargo:token get crates-io +[WARNING] no (git) Cargo.toml found at `target/tmp/cit/t50/foo/Cargo.toml` in workdir `/Users/eth3lbert/workspace/rust-lang/cargo/` +[ERROR] license-file `foo` does not appear to exist (relative to `[ROOT]/foo`). +Please update the license-file setting in the manifest at `[ROOT]/foo/Cargo.toml`. + +"#]] + } else { + str![[r#" +[UPDATING] crates.io index +[CREDENTIAL] cargo:token get crates-io +[WARNING] no (git) Cargo.toml found at `target/tmp/cit/t49/foo/Cargo.toml` in workdir `/Users/eth3lbert/workspace/rust-lang/cargo/` +[ERROR] license-file `foo` does not appear to exist (relative to `[ROOT]/foo`). +Please update the license-file setting in the manifest at `[ROOT]/foo/Cargo.toml`. + +"#]] + }; p.cargo("publish -v") .replace_crates_io(registry.index_url()) .with_status(101) - .with_stderr_contains("[ERROR] license-file `foo` does not appear to exist ([..]).") + .with_stderr_data(expected) .run(); } #[cargo_test] fn updating_a_dep_http() { let _server = setup_http(); - updating_a_dep(); + updating_a_dep(true); } #[cargo_test] fn updating_a_dep_git() { - updating_a_dep(); + updating_a_dep(false); } -fn updating_a_dep() { +fn updating_a_dep(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1197,20 +1576,32 @@ fn updating_a_dep() { Package::new("bar", "0.0.1").publish(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 3 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) [CHECKING] bar v0.0.1 -[CHECKING] a v0.0.1 ([CWD]/a) -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] a v0.0.1 ([ROOT]/foo/a) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 3 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) +[CHECKING] bar v0.0.1 +[CHECKING] a v0.0.1 ([ROOT]/foo/a) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); assert!(paths::home().join(".cargo/registry/CACHEDIR.TAG").is_file()); // Now delete the CACHEDIR.TAG file: this is the situation we'll be in after @@ -1235,21 +1626,34 @@ fn updating_a_dep() { Package::new("bar", "0.1.0").publish(); println!("second"); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [UPDATING] bar v0.0.1 -> v0.1.0 [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 (registry `dummy-registry`) [CHECKING] bar v0.1.0 -[CHECKING] a v0.0.1 ([CWD]/a) -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] a v0.0.1 ([ROOT]/foo/a) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[UPDATING] bar v0.0.1 -> v0.1.0 +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.1.0 (registry `dummy-registry`) +[CHECKING] bar v0.1.0 +[CHECKING] a v0.0.1 ([ROOT]/foo/a) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); assert!( paths::home().join(".cargo/registry/CACHEDIR.TAG").is_file(), @@ -1260,15 +1664,15 @@ fn updating_a_dep() { #[cargo_test] fn git_and_registry_dep_http() { let _server = setup_http(); - git_and_registry_dep(); + git_and_registry_dep(true); } #[cargo_test] fn git_and_registry_dep_git() { - git_and_registry_dep(); + git_and_registry_dep(false); } -fn git_and_registry_dep() { +fn git_and_registry_dep(is_http: bool) { let b = git::repo(&paths::root().join("b")) .file( "Cargo.toml", @@ -1311,39 +1715,63 @@ fn git_and_registry_dep() { Package::new("a", "0.0.1").publish(); p.root().move_into_the_past(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] [..] -[UPDATING] [..] + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[UPDATING] git repository `[ROOTURL]/b` [LOCKING] 3 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] a v0.0.1 (registry `dummy-registry`) [CHECKING] a v0.0.1 -[CHECKING] b v0.0.1 ([..]) -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] b v0.0.1 ([ROOTURL]/b#[..]) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[UPDATING] git repository `[ROOTURL]/b` +[LOCKING] 3 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] a v0.0.1 (registry `dummy-registry`) +[CHECKING] a v0.0.1 +[CHECKING] b v0.0.1 ([ROOTURL]/b#[..]) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); p.root().move_into_the_past(); println!("second"); - p.cargo("check").with_stderr("[FINISHED] [..]").run(); + let expected = if is_http { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn update_publish_then_update_http() { let _server = setup_http(); - update_publish_then_update(); + update_publish_then_update(true); } #[cargo_test] fn update_publish_then_update_git() { - update_publish_then_update(); + update_publish_then_update(false); } -fn update_publish_then_update() { +fn update_publish_then_update(is_http: bool) { // First generate a Cargo.lock and a clone of the registry index at the // "head" of the current registry. let p = project() @@ -1399,35 +1827,45 @@ fn update_publish_then_update() { p.root().join("Cargo.lock") )); - // Finally, build the first project again (with our newer Cargo.lock) which - // should force an update of the old registry, download the new crate, and - // then build everything again. - p.cargo("build") - .with_stderr( - "\ -[UPDATING] [..] + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] a v0.1.1 (registry `dummy-registry`) [COMPILING] a v0.1.1 -[COMPILING] foo v0.5.0 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[COMPILING] foo v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[DOWNLOADING] crates ... +[DOWNLOADED] a v0.1.1 (registry `dummy-registry`) +[COMPILING] a v0.1.1 +[COMPILING] foo v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + // Finally, build the first project again (with our newer Cargo.lock) which + // should force an update of the old registry, download the new crate, and + // then build everything again. + p.cargo("build").with_stderr_data(expected).run(); } #[cargo_test] fn fetch_downloads_http() { let _server = setup_http(); - fetch_downloads(); + fetch_downloads(true); } #[cargo_test] fn fetch_downloads_git() { - fetch_downloads(); + fetch_downloads(false); } -fn fetch_downloads() { +fn fetch_downloads(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1447,30 +1885,38 @@ fn fetch_downloads() { Package::new("a", "0.1.0").publish(); - p.cargo("fetch") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] a v0.1.0 (registry [..]) -", - ) - .run(); +[DOWNLOADED] a v0.1.0 (registry `dummy-registry`) + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] a v0.1.0 (registry `dummy-registry`) + +"#]] + }; + p.cargo("fetch").with_stderr_data(expected).run(); } #[cargo_test] fn update_transitive_dependency_http() { let _server = setup_http(); - update_transitive_dependency(); + update_transitive_dependency(true); } #[cargo_test] fn update_transitive_dependency_git() { - update_transitive_dependency(); + update_transitive_dependency(false); } -fn update_transitive_dependency() { +fn update_transitive_dependency(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1495,42 +1941,59 @@ fn update_transitive_dependency() { Package::new("b", "0.1.1").publish(); - p.cargo("update b") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[UPDATING] b v0.1.0 -> v0.1.1 + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [UPDATING] b v0.1.0 -> v0.1.1 -", - ) - .run(); - p.cargo("check") - .with_stderr( - "\ +"#]] + }; + p.cargo("update b").with_stderr_data(expected).run(); + + let expected = if is_http { + str![[r#" [DOWNLOADING] crates ... [DOWNLOADED] b v0.1.1 (registry `dummy-registry`) [CHECKING] b v0.1.1 [CHECKING] a v0.1.0 -[CHECKING] foo v0.5.0 ([..]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[DOWNLOADING] crates ... +[DOWNLOADED] b v0.1.1 (registry `dummy-registry`) +[CHECKING] b v0.1.1 +[CHECKING] a v0.1.0 +[CHECKING] foo v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn update_backtracking_ok_http() { let _server = setup_http(); - update_backtracking_ok(); + update_backtracking_ok(true); } #[cargo_test] fn update_backtracking_ok_git() { - update_backtracking_ok(); + update_backtracking_ok(false); } -fn update_backtracking_ok() { +fn update_backtracking_ok(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1568,30 +2031,38 @@ fn update_backtracking_ok() { .dep("cookie", "0.1.0") .publish(); - p.cargo("update hyper") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [UPDATING] hyper v0.6.5 -> v0.6.6 [UPDATING] openssl v0.1.0 -> v0.1.1 -", - ) - .run(); + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[UPDATING] hyper v0.6.5 -> v0.6.6 +[UPDATING] openssl v0.1.0 -> v0.1.1 + +"#]] + }; + p.cargo("update hyper").with_stderr_data(expected).run(); } #[cargo_test] fn update_multiple_packages_http() { let _server = setup_http(); - update_multiple_packages(); + update_multiple_packages(true); } #[cargo_test] fn update_multiple_packages_git() { - update_multiple_packages(); + update_multiple_packages(false); } -fn update_multiple_packages() { +fn update_multiple_packages(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1621,37 +2092,74 @@ fn update_multiple_packages() { Package::new("b", "0.1.1").publish(); Package::new("c", "0.1.1").publish(); - p.cargo("update a b") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [UPDATING] a v0.1.0 -> v0.1.1 [UPDATING] b v0.1.0 -> v0.1.1 [NOTE] pass `--verbose` to see 1 unchanged dependencies behind latest -", - ) - .run(); - p.cargo("update b c") - .with_stderr( - "\ -[UPDATING] `[..]` index +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[UPDATING] a v0.1.0 -> v0.1.1 +[UPDATING] b v0.1.0 -> v0.1.1 +[NOTE] pass `--verbose` to see 1 unchanged dependencies behind latest + +"#]] + }; + p.cargo("update a b").with_stderr_data(expected).run(); + + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [UPDATING] c v0.1.0 -> v0.1.1 -", - ) - .run(); - p.cargo("check") - .with_stderr_contains("[DOWNLOADED] a v0.1.1 (registry `dummy-registry`)") - .with_stderr_contains("[DOWNLOADED] b v0.1.1 (registry `dummy-registry`)") - .with_stderr_contains("[DOWNLOADED] c v0.1.1 (registry `dummy-registry`)") - .with_stderr_contains("[CHECKING] a v0.1.1") - .with_stderr_contains("[CHECKING] b v0.1.1") - .with_stderr_contains("[CHECKING] c v0.1.1") - .with_stderr_contains("[CHECKING] foo v0.5.0 ([..])") - .run(); +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 1 package to latest compatible version +[UPDATING] c v0.1.0 -> v0.1.1 + +"#]] + }; + p.cargo("update b c").with_stderr_data(expected).run(); + + let expected = if is_http { + str![[r#" +[DOWNLOADING] crates ... +[DOWNLOADED] a v0.1.1 (registry `dummy-registry`) +[DOWNLOADED] b v0.1.1 (registry `dummy-registry`) +[DOWNLOADED] c v0.1.1 (registry `dummy-registry`) +[CHECKING] a v0.1.1 +[CHECKING] b v0.1.1 +[CHECKING] c v0.1.1 +[CHECKING] foo v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + .unordered() + } else { + str![[r#" +[DOWNLOADING] crates ... +[DOWNLOADED] c v0.1.1 (registry `dummy-registry`) +[DOWNLOADED] b v0.1.1 (registry `dummy-registry`) +[DOWNLOADED] a v0.1.1 (registry `dummy-registry`) +[CHECKING] a v0.1.1 +[CHECKING] c v0.1.1 +[CHECKING] b v0.1.1 +[CHECKING] foo v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + .unordered() + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] @@ -1783,15 +2291,15 @@ fn use_semver() { #[cargo_test] fn use_semver_package_incorrectly_http() { let _server = setup_http(); - use_semver_package_incorrectly(); + use_semver_package_incorrectly(true); } #[cargo_test] fn use_semver_package_incorrectly_git() { - use_semver_package_incorrectly(); + use_semver_package_incorrectly(false); } -fn use_semver_package_incorrectly() { +fn use_semver_package_incorrectly(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1827,33 +2335,45 @@ fn use_semver_package_incorrectly() { .file("b/src/main.rs", "fn main() {}") .build(); - p.cargo("check") - .with_status(101) - .with_stderr( - "\ -error: failed to select a version for the requirement `a = \"^0.1\"` + let expected = if is_http { + str![[r#" +[ERROR] failed to select a version for the requirement `a = "^0.1"` candidate versions found which didn't match: 0.1.1-alpha.0 -location searched: [..] -required by package `b v0.1.0 ([..])` +location searched: [ROOT]/foo/a +required by package `b v0.1.0 ([ROOT]/foo/b)` if you are looking for the prerelease package it needs to be specified explicitly - a = { version = \"0.1.1-alpha.0\" } -", - ) + a = { version = "0.1.1-alpha.0" } + +"#]] + } else { + str![[r#" +[ERROR] failed to select a version for the requirement `a = "^0.1"` +candidate versions found which didn't match: 0.1.1-alpha.0 +location searched: [ROOT]/foo/a +required by package `b v0.1.0 ([ROOT]/foo/b)` +if you are looking for the prerelease package it needs to be specified explicitly + a = { version = "0.1.1-alpha.0" } + +"#]] + }; + p.cargo("check") + .with_status(101) + .with_stderr_data(expected) .run(); } #[cargo_test] fn only_download_relevant_http() { let _server = setup_http(); - only_download_relevant(); + only_download_relevant(true); } #[cargo_test] fn only_download_relevant_git() { - only_download_relevant(); + only_download_relevant(false); } -fn only_download_relevant() { +fn only_download_relevant(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1879,19 +2399,30 @@ fn only_download_relevant() { Package::new("bar", "0.1.0").publish(); Package::new("baz", "0.1.0").publish(); - p.cargo("check") - .with_stderr( - "\ -[UPDATING] `[..]` index + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 4 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] baz v0.1.0 ([..]) +[DOWNLOADED] baz v0.1.0 (registry `dummy-registry`) [CHECKING] baz v0.1.0 -[CHECKING] bar v0.5.0 ([..]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] bar v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 4 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] baz v0.1.0 (registry `dummy-registry`) +[CHECKING] baz v0.1.0 +[CHECKING] bar v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] @@ -1934,15 +2465,15 @@ fn resolve_and_backtracking() { #[cargo_test] fn upstream_warnings_on_extra_verbose_http() { let _server = setup_http(); - upstream_warnings_on_extra_verbose(); + upstream_warnings_on_extra_verbose(true); } #[cargo_test] fn upstream_warnings_on_extra_verbose_git() { - upstream_warnings_on_extra_verbose(); + upstream_warnings_on_extra_verbose(false); } -fn upstream_warnings_on_extra_verbose() { +fn upstream_warnings_on_extra_verbose(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -1964,9 +2495,20 @@ fn upstream_warnings_on_extra_verbose() { .file("src/lib.rs", "fn unused() {}") .publish(); - p.cargo("check -vv") - .with_stderr_contains("[WARNING] [..]unused[..]") - .run(); + let expected = if is_http { + str![[r#" +... +[WARNING] function `unused` is never used +... +"#]] + } else { + str![[r#" +... +[WARNING] function `unused` is never used +... +"#]] + }; + p.cargo("check -vv").with_stderr_data(expected).run(); } #[cargo_test] @@ -1991,18 +2533,17 @@ fn disallow_network_http() { p.cargo("check --frozen") .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] -[ERROR] failed to get `foo` as a dependency of package `bar v0.5.0 ([..])` + .with_stderr_data(str![[r#" +[UPDATING] `dummy-registry` index +[ERROR] failed to get `foo` as a dependency of package `bar v0.5.0 ([ROOT]/foo)` Caused by: failed to query replaced source registry `crates-io` Caused by: attempting to make an HTTP request, but --frozen was specified -", - ) + +"#]]) .run(); } @@ -2028,9 +2569,8 @@ fn disallow_network_git() { p.cargo("check --frozen") .with_status(101) - .with_stderr( - "\ -[ERROR] failed to get `foo` as a dependency of package `bar v0.5.0 [..]` + .with_stderr_data(str![[r#" +[ERROR] failed to get `foo` as a dependency of package `bar v0.5.0 ([ROOT]/foo)` Caused by: failed to load source for dependency `foo` @@ -2043,23 +2583,23 @@ Caused by: Caused by: attempting to make an HTTP request, but --frozen was specified -", - ) + +"#]]) .run(); } #[cargo_test] fn add_dep_dont_update_registry_http() { let _server = setup_http(); - add_dep_dont_update_registry(); + add_dep_dont_update_registry(true); } #[cargo_test] fn add_dep_dont_update_registry_git() { - add_dep_dont_update_registry(); + add_dep_dont_update_registry(false); } -fn add_dep_dont_update_registry() { +fn add_dep_dont_update_registry(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -2110,28 +2650,34 @@ fn add_dep_dont_update_registry() { "#, ); - p.cargo("check") - .with_stderr( - "\ -[CHECKING] bar v0.5.0 ([..]) -[FINISHED] [..] -", - ) - .run(); + let expected = if is_http { + str![[r#" +[CHECKING] bar v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[CHECKING] bar v0.5.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] fn bump_version_dont_update_registry_http() { let _server = setup_http(); - bump_version_dont_update_registry(); + bump_version_dont_update_registry(true); } #[cargo_test] fn bump_version_dont_update_registry_git() { - bump_version_dont_update_registry(); + bump_version_dont_update_registry(false); } -fn bump_version_dont_update_registry() { +fn bump_version_dont_update_registry(is_http: bool) { let p = project() .file( "Cargo.toml", @@ -2181,16 +2727,24 @@ fn bump_version_dont_update_registry() { "#, ); - p.cargo("check") - .with_stderr( - "\ + let expected = if is_http { + str![[r#" [LOCKING] 1 package to latest compatible version -[UPDATING] bar v0.5.0 ([CWD]) -> v0.6.0 -[CHECKING] bar v0.6.0 ([..]) -[FINISHED] [..] -", - ) - .run(); +[UPDATING] bar v0.5.0 ([ROOT]/foo) -> v0.6.0 +[CHECKING] bar v0.6.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + } else { + str![[r#" +[LOCKING] 1 package to latest compatible version +[UPDATING] bar v0.5.0 ([ROOT]/foo) -> v0.6.0 +[CHECKING] bar v0.6.0 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]] + }; + p.cargo("check").with_stderr_data(expected).run(); } #[cargo_test] @@ -2286,15 +2840,15 @@ fn vv_prints_warnings() { #[cargo_test] fn bad_and_or_malicious_packages_rejected_http() { let _server = setup_http(); - bad_and_or_malicious_packages_rejected(); + bad_and_or_malicious_packages_rejected(true); } #[cargo_test] fn bad_and_or_malicious_packages_rejected_git() { - bad_and_or_malicious_packages_rejected(); + bad_and_or_malicious_packages_rejected(false); } -fn bad_and_or_malicious_packages_rejected() { +fn bad_and_or_malicious_packages_rejected(is_http: bool) { Package::new("foo", "0.2.0") .extra_file("foo-0.1.0/src/lib.rs", "") .publish(); @@ -2316,23 +2870,40 @@ fn bad_and_or_malicious_packages_rejected() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("check -vv") - .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] + let expected = if is_http { + str![[r#" +[UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] [..] -error: failed to download [..] +[DOWNLOADED] foo v0.2.0 (registry `dummy-registry`) +[ERROR] failed to download replaced source registry `crates-io` Caused by: - failed to unpack [..] + failed to unpack package `foo v0.2.0 (registry `dummy-registry`)` Caused by: - [..] contains a file at \"foo-0.1.0/src/lib.rs\" which isn't under \"foo-0.2.0\" -", - ) + invalid tarball downloaded, contains a file at "foo-0.1.0/src/lib.rs" which isn't under "foo-0.2.0" + +"#]] + } else { + str![[r#" +[UPDATING] `dummy-registry` index +[LOCKING] 2 packages to latest compatible versions +[DOWNLOADING] crates ... +[DOWNLOADED] foo v0.2.0 (registry `dummy-registry`) +[ERROR] failed to download replaced source registry `crates-io` + +Caused by: + failed to unpack package `foo v0.2.0 (registry `dummy-registry`)` + +Caused by: + invalid tarball downloaded, contains a file at "foo-0.1.0/src/lib.rs" which isn't under "foo-0.2.0" + +"#]] + }; + p.cargo("check -vv") + .with_status(101) + .with_stderr_data(expected) .run(); } @@ -2552,15 +3123,15 @@ fn readonly_registry_still_works() { #[cargo_test] fn registry_index_rejected_http() { let _server = setup_http(); - registry_index_rejected(); + registry_index_rejected(true); } #[cargo_test] fn registry_index_rejected_git() { - registry_index_rejected(); + registry_index_rejected(false); } -fn registry_index_rejected() { +fn registry_index_rejected(is_http: bool) { Package::new("dep", "0.1.0").publish(); let p = project() @@ -2586,27 +3157,46 @@ fn registry_index_rejected() { .file("src/lib.rs", "") .build(); - p.cargo("check") - .with_status(101) - .with_stderr( - "\ -[ERROR] failed to parse manifest at `[..]/foo/Cargo.toml` + let expected = if is_http { + str![[r#" +[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` Caused by: the `registry.index` config value is no longer supported Use `[source]` replacement to alter the default index for crates.io. -", - ) - .run(); - p.cargo("login") +"#]] + } else { + str![[r#" +[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` + +Caused by: + the `registry.index` config value is no longer supported + Use `[source]` replacement to alter the default index for crates.io. + +"#]] + }; + p.cargo("check") .with_status(101) - .with_stderr( - "\ + .with_stderr_data(expected) + .run(); + + let expected = if is_http { + str![[r#" [ERROR] the `registry.index` config value is no longer supported Use `[source]` replacement to alter the default index for crates.io. -", - ) + +"#]] + } else { + str![[r#" +[ERROR] the `registry.index` config value is no longer supported +Use `[source]` replacement to alter the default index for crates.io. + +"#]] + }; + p.cargo("login") + .with_status(101) + .with_stderr_data(expected) .run(); } @@ -2694,15 +3284,15 @@ fn package_lock_as_a_symlink_inside_package_is_overwritten() { #[cargo_test] fn ignores_unknown_index_version_http() { let _server = setup_http(); - ignores_unknown_index_version(); + ignores_unknown_index_version(true); } #[cargo_test] fn ignores_unknown_index_version_git() { - ignores_unknown_index_version(); + ignores_unknown_index_version(false); } -fn ignores_unknown_index_version() { +fn ignores_unknown_index_version(is_http: bool) { // If the version field is not understood, it is ignored. Package::new("bar", "1.0.0").publish(); Package::new("bar", "1.0.1") @@ -2725,13 +3315,20 @@ fn ignores_unknown_index_version() { .file("src/lib.rs", "") .build(); - p.cargo("tree") - .with_stdout( - "foo v0.1.0 [..]\n\ - └── bar v1.0.0\n\ - ", - ) - .run(); + let expected = if is_http { + str![[r#" +foo v0.1.0 ([ROOT]/foo) +└── bar v1.0.0 + +"#]] + } else { + str![[r#" +foo v0.1.0 ([ROOT]/foo) +└── bar v1.0.0 + +"#]] + }; + p.cargo("tree").with_stdout_data(expected).run(); } #[cargo_test] @@ -2759,14 +3356,13 @@ fn unknown_index_version_error() { p.cargo("generate-lockfile") .with_status(101) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [ERROR] no matching package named `bar` found location searched: registry `crates-io` -required by package `foo v0.1.0 ([CWD])` -", - ) +required by package `foo v0.1.0 ([ROOT]/foo)` + +"#]]) .run(); } @@ -2775,7 +3371,10 @@ fn protocol() { cargo_process("install bar") .with_status(101) .env("CARGO_REGISTRIES_CRATES_IO_PROTOCOL", "invalid") - .with_stderr("[ERROR] unsupported registry protocol `invalid` (defined in environment variable `CARGO_REGISTRIES_CRATES_IO_PROTOCOL`)") + .with_stderr_data(str![[r#" +[ERROR] unsupported registry protocol `invalid` (defined in environment variable `CARGO_REGISTRIES_CRATES_IO_PROTOCOL`) + +"#]]) .run() } @@ -2783,7 +3382,10 @@ fn protocol() { fn http_requires_trailing_slash() { cargo_process("install bar --index sparse+https://invalid.crates.io/test") .with_status(101) - .with_stderr("[ERROR] sparse registry url must end in a slash `/`: sparse+https://invalid.crates.io/test") + .with_stderr_data(str![[r#" +[ERROR] sparse registry url must end in a slash `/`: sparse+https://invalid.crates.io/test + +"#]]) .run() } @@ -2814,8 +3416,7 @@ fn reach_max_unpack_size() { .env("__CARGO_TEST_MAX_UNPACK_SIZE", "8") // hit 8 bytes limit and boom! .env("__CARGO_TEST_MAX_UNPACK_RATIO", "0") .with_status(101) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... @@ -2830,20 +3431,19 @@ Caused by: Caused by: maximum limit reached when reading -", - ) + +"#]]) .run(); // Restore to the default ratio and it should compile. p.cargo("check") .env("__CARGO_TEST_MAX_UNPACK_SIZE", "8") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([..]) -[FINISHED] `dev` profile [..] -", - ) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]) .run(); } @@ -2882,25 +3482,22 @@ fn sparse_retry_single() { Package::new("bar", "0.0.1").publish(); - p.cargo("check") - .with_stderr( - "\ + p.cargo("check").with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index -warning: spurious network error (3 tries remaining): failed to get successful HTTP response from `[..]` (127.0.0.1), got 500 +[WARNING] spurious network error (3 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 500 body: internal server error -warning: spurious network error (2 tries remaining): failed to get successful HTTP response from `[..]` (127.0.0.1), got 500 +[WARNING] spurious network error (2 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 500 body: internal server error [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) [CHECKING] bar v0.0.1 -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) - .run(); +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]).run(); } #[cargo_test] @@ -2959,7 +3556,7 @@ fn sparse_retry_multiple() { let remain = 3 - retry; write!( &mut expected, - "warning: spurious network error ({remain} tries remaining): \ + "[WARNING] spurious network error ({remain} tries remaining): \ failed to get successful HTTP response from \ `http://127.0.0.1:[..]/{ab}/{cd}/{name}` (127.0.0.1), got 500\n\ body:\n\ @@ -2990,7 +3587,9 @@ fn sparse_retry_multiple() { .file("Cargo.toml", &cargo_toml) .file("src/lib.rs", "") .build(); - p.cargo("fetch").with_stderr_unordered(expected).run(); + p.cargo("fetch") + .with_stderr_data(IntoData::unordered(expected)) + .run(); } #[cargo_test] @@ -3027,21 +3626,19 @@ fn dl_retry_single() { ) .file("src/lib.rs", "") .build(); - p.cargo("fetch") - .with_stderr("\ + p.cargo("fetch").with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -warning: spurious network error (3 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 500 +[WARNING] spurious network error (3 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 500 body: internal server error -warning: spurious network error (2 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 500 +[WARNING] spurious network error (2 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 500 body: internal server error [DOWNLOADED] bar v1.0.0 (registry `dummy-registry`) -").run(); + +"#]]).run(); } /// Creates a random prefix to randomly spread out the package names @@ -3111,7 +3708,7 @@ fn dl_retry_multiple() { let remain = 3 - retry; write!( &mut expected, - "warning: spurious network error ({remain} tries remaining): \ + "[WARNING] spurious network error ({remain} tries remaining): \ failed to get successful HTTP response from \ `http://127.0.0.1:[..]/dl/{name}/1.0.0/download` (127.0.0.1), got 500\n\ body:\n\ @@ -3138,7 +3735,9 @@ fn dl_retry_multiple() { .file("Cargo.toml", &cargo_toml) .file("src/lib.rs", "") .build(); - p.cargo("fetch").with_stderr_unordered(expected).run(); + p.cargo("fetch") + .with_stderr_data(IntoData::unordered(expected)) + .run(); } #[cargo_test] @@ -3169,20 +3768,18 @@ fn deleted_entry() { let old_index = fs::read_to_string(&bar_reg_path).unwrap(); Package::new("bar", "0.1.1").publish(); p.cargo("tree") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.1 (registry `dummy-registry`) -", - ) - .with_stdout( - "\ + +"#]]) + .with_stdout_data(str![[r#" foo v0.1.0 ([ROOT]/foo) └── bar v0.1.1 -", - ) + +"#]]) .run(); // Remove 0.1.1 @@ -3196,32 +3793,29 @@ foo v0.1.0 ([ROOT]/foo) // With `Cargo.lock` unchanged, it shouldn't have an impact. p.cargo("tree") - .with_stderr("") - .with_stdout( - "\ + .with_stderr_data("") + .with_stdout_data(str![[r#" foo v0.1.0 ([ROOT]/foo) └── bar v0.1.1 -", - ) + +"#]]) .run(); // Regenerating Cargo.lock should switch to old version. fs::remove_file(p.root().join("Cargo.lock")).unwrap(); p.cargo("tree") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 (registry `dummy-registry`) -", - ) - .with_stdout( - "\ + +"#]]) + .with_stdout_data(str![[r#" foo v0.1.0 ([ROOT]/foo) └── bar v0.1.0 -", - ) + +"#]]) .run(); // Remove the package entirely. @@ -3234,26 +3828,24 @@ foo v0.1.0 ([ROOT]/foo) // With `Cargo.lock` unchanged, it shouldn't have an impact. p.cargo("tree") - .with_stderr("") - .with_stdout( - "\ + .with_stderr_data("") + .with_stdout_data(str![[r#" foo v0.1.0 ([ROOT]/foo) └── bar v0.1.0 -", - ) + +"#]]) .run(); // Regenerating Cargo.lock should fail. fs::remove_file(p.root().join("Cargo.lock")).unwrap(); p.cargo("tree") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index -error: no matching package named `bar` found +[ERROR] no matching package named `bar` found location searched: registry `crates-io` required by package `foo v0.1.0 ([ROOT]/foo)` -", - ) + +"#]]) .with_status(101) .run(); } @@ -3279,14 +3871,13 @@ fn corrupted_ok_overwritten() { .file("src/lib.rs", "") .build(); p.cargo("fetch") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v1.0.0 (registry `dummy-registry`) -", - ) + +"#]]) .run(); let ok = glob::glob( paths::home() @@ -3301,7 +3892,7 @@ fn corrupted_ok_overwritten() { // Simulate cargo being interrupted, or filesystem corruption. fs::write(&ok, "").unwrap(); assert_eq!(fs::read_to_string(&ok).unwrap(), ""); - p.cargo("fetch").with_stderr("").run(); + p.cargo("fetch").with_stderr_data("").run(); assert_eq!(fs::read_to_string(&ok).unwrap(), r#"{"v":1}"#); } @@ -3342,14 +3933,13 @@ fn not_found_permutations() { p.cargo("check") .with_status(101) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index -error: no matching package named `a-b_c` found +[ERROR] no matching package named `a-b_c` found location searched: registry `crates-io` required by package `foo v0.0.1 ([ROOT]/foo)` -", - ) + +"#]]) .run(); let mut misses = misses.lock().unwrap(); misses.sort(); @@ -3389,25 +3979,23 @@ fn default_auth_error() { // Test output before setting the default. p.cargo("publish --no-verify") .replace_crates_io(crates_io.index_url()) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] crates.io index -error: no token found, please run `cargo login` +[ERROR] no token found, please run `cargo login` or use environment variable CARGO_REGISTRY_TOKEN -", - ) + +"#]]) .with_status(101) .run(); p.cargo("publish --no-verify --registry alternative") .replace_crates_io(crates_io.index_url()) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `alternative` index -error: no token found for `alternative`, please run `cargo login --registry alternative` +[ERROR] no token found for `alternative`, please run `cargo login --registry alternative` or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN -", - ) + +"#]]) .with_status(101) .run(); @@ -3423,25 +4011,23 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN p.cargo("publish --no-verify") .replace_crates_io(crates_io.index_url()) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `alternative` index -error: no token found for `alternative`, please run `cargo login --registry alternative` +[ERROR] no token found for `alternative`, please run `cargo login --registry alternative` or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN -", - ) + +"#]]) .with_status(101) .run(); p.cargo("publish --no-verify --registry crates-io") .replace_crates_io(crates_io.index_url()) - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] crates.io index -error: no token found, please run `cargo login --registry crates-io` +[ERROR] no token found, please run `cargo login --registry crates-io` or use environment variable CARGO_REGISTRY_TOKEN -", - ) + +"#]]) .with_status(101) .run(); } @@ -3485,21 +4071,20 @@ fn debug_header_message_index() { ) .file("src/lib.rs", "") .build(); - p.cargo("fetch").with_status(101).with_stderr("\ + p.cargo("fetch") + .with_status(101) + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index -warning: spurious network error (3 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 503 +[WARNING] spurious network error (3 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 503 body: Please slow down -warning: spurious network error (2 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 503 +[WARNING] spurious network error (2 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 503 body: Please slow down -warning: spurious network error (1 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 503 +[WARNING] spurious network error (1 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/index/3/b/bar` (127.0.0.1), got 503 body: Please slow down -error: failed to get `bar` as a dependency of package `foo v0.1.0 ([ROOT]/foo)` +[ERROR] failed to get `bar` as a dependency of package `foo v0.1.0 ([ROOT]/foo)` Caused by: failed to query replaced source registry `crates-io` @@ -3515,7 +4100,9 @@ Caused by: x-cache: Hit from cloudfront body: Please slow down -").run(); + +"#]]) + .run(); } #[cargo_test] @@ -3547,23 +4134,22 @@ fn debug_header_message_dl() { .file("src/lib.rs", "") .build(); - p.cargo("fetch").with_status(101).with_stderr("\ + p.cargo("fetch") + .with_status(101) + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -warning: spurious network error (3 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 +[WARNING] spurious network error (3 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 body: Please slow down -warning: spurious network error (2 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 +[WARNING] spurious network error (2 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 body: Please slow down -warning: spurious network error (1 tries remaining): \ - failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 +[WARNING] spurious network error (1 tries remaining): failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 body: Please slow down -error: failed to download from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` +[ERROR] failed to download from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` Caused by: failed to get successful HTTP response from `http://127.0.0.1:[..]/dl/bar/1.0.0/download` (127.0.0.1), got 503 @@ -3573,7 +4159,9 @@ Caused by: x-cache: Hit from cloudfront body: Please slow down -").run(); + +"#]]) + .run(); } #[cfg(unix)] @@ -3603,14 +4191,13 @@ fn set_mask_during_unpacking() { .build(); p.cargo("fetch") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v1.0.0 (registry `dummy-registry`) -", - ) + +"#]]) .run(); let src_file_path = |path: &str| { glob::glob( @@ -3654,14 +4241,13 @@ fn unpack_again_when_cargo_ok_is_unrecognized() { .build(); p.cargo("fetch") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... [DOWNLOADED] bar v1.0.0 (registry `dummy-registry`) -", - ) + +"#]]) .run(); let src_file_path = |path: &str| { @@ -3688,7 +4274,7 @@ fn unpack_again_when_cargo_ok_is_unrecognized() { let ok = fs::read_to_string(&cargo_ok).unwrap(); assert_eq!(&ok, r#"{"v":1}"#); - p.cargo("fetch").with_stderr("").run(); + p.cargo("fetch").with_stderr_data("").run(); // Without changing `.cargo-ok`, a unpack won't be triggered. let perms = fs::metadata(&lib_rs).unwrap().permissions(); @@ -3697,7 +4283,7 @@ fn unpack_again_when_cargo_ok_is_unrecognized() { // Write "ok" to simulate the old behavior and trigger the unpack again. fs::write(&cargo_ok, "ok").unwrap(); - p.cargo("fetch").with_stderr("").run(); + p.cargo("fetch").with_stderr_data("").run(); // Permission has been restored and `.cargo-ok` is in the new format. let perms = fs::metadata(lib_rs).unwrap().permissions(); @@ -3729,24 +4315,28 @@ fn differ_only_by_metadata() { Package::new("baz", "0.0.1+c").yanked(true).publish(); p.cargo("check") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.1+b (registry `dummy-registry`) +[DOWNLOADED] baz v0.0.1+b (registry `dummy-registry`) [CHECKING] baz v0.0.1+b -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]) .run(); Package::new("baz", "0.0.1+d").publish(); p.cargo("clean").run(); p.cargo("check") - .with_stderr_contains("[CHECKING] baz v0.0.1+b") + .with_stderr_data(str![[r#" +[CHECKING] baz v0.0.1+b +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]) .run(); } @@ -3774,24 +4364,22 @@ fn differ_only_by_metadata_with_lockfile() { Package::new("baz", "0.0.1+c").publish(); p.cargo("update --package baz --precise 0.0.1+b") - .with_stderr( - "\ -[UPDATING] [..] index -[..] baz v0.0.1+c -> v0.0.1+b -", - ) + .with_stderr_data(str![[r#" +[UPDATING] `dummy-registry` index +[UPDATING] baz v0.0.1+c -> v0.0.1+b + +"#]]) .run(); p.cargo("check") - .with_stderr( - "\ + .with_stderr_data(str![[r#" [DOWNLOADING] crates ... -[DOWNLOADED] [..] v0.0.1+b (registry `dummy-registry`) +[DOWNLOADED] baz v0.0.1+b (registry `dummy-registry`) [CHECKING] baz v0.0.1+b -[CHECKING] foo v0.0.1 ([CWD]) -[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s -", - ) +[CHECKING] foo v0.0.1 ([ROOT]/foo) +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s + +"#]]) .run(); } @@ -3824,15 +4412,14 @@ fn builtin_source_replacement() { p.cargo("check -v") .replace_crates_io(&server.index_url()) .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] index + .with_stderr_data(str![[r#" +[UPDATING] crates.io index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] bad-cksum [..] +[DOWNLOADED] bad-cksum v0.0.1 [ERROR] failed to verify the checksum of `bad-cksum v0.0.1` -", - ) + +"#]]) .run(); } @@ -3864,14 +4451,13 @@ fn builtin_source_replacement_no_vendor_error() { p.cargo("check -v") .replace_crates_io(&server.index_url()) .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] index -[ERROR] failed to select a version for the requirement `dep = \"^0.2.0\"` + .with_stderr_data(str![[r#" +[UPDATING] crates.io index +[ERROR] failed to select a version for the requirement `dep = "^0.2.0"` candidate versions found which didn't match: 0.1.0 location searched: crates.io index -required by package `foo v0.0.1 ([..])` -", - ) +required by package `foo v0.0.1 ([ROOT]/foo)` + +"#]]) .run(); }