Fix tests (to do with printing).
authorWithout Boats <woboats@gmail.com>
Wed, 4 Oct 2017 22:07:01 +0000 (15:07 -0700)
committerWithout Boats <woboats@gmail.com>
Wed, 4 Oct 2017 22:07:01 +0000 (15:07 -0700)
src/cargo/ops/cargo_install.rs
src/cargo/sources/replaced.rs
tests/install.rs
tests/local-registry.rs
tests/registry.rs
tests/resolve.rs

index 12fe51c441e81a8d35675473a58a76278b5d435c..4c88e8951f7b79df46223ee43c75ef1a034bcffe 100644 (file)
@@ -390,7 +390,7 @@ fn select_pkg<'a, T>(mut source: T,
                 None => {
                     let vers_info = vers.map(|v| format!(" with version `{}`", v))
                                         .unwrap_or_default();
-                    Err(format!("could not find `{}` in `{}`{}", name,
+                    Err(format!("could not find `{}` in {}{}", name,
                                 source.source_id(), vers_info).into())
                 }
             }
index 5048f618661b12d30ed00a26ad53c53d95807534..883906146083d338ac5912b4a2edf27cf2b1ef45 100644 (file)
@@ -29,7 +29,7 @@ impl<'cfg> Registry for ReplacedSource<'cfg> {
         self.inner.query(&dep, &mut |summary| {
             f(summary.map_source(replace_with, to_replace))
         }).chain_err(|| {
-            format!("failed to query replaced source `{}`",
+            format!("failed to query replaced source {}",
                     self.to_replace)
         })
     }
@@ -50,7 +50,7 @@ impl<'cfg> Source for ReplacedSource<'cfg> {
 
     fn update(&mut self) -> CargoResult<()> {
         self.inner.update().chain_err(|| {
-            format!("failed to update replaced source `{}`",
+            format!("failed to update replaced source {}",
                     self.to_replace)
         })
     }
@@ -58,7 +58,7 @@ impl<'cfg> Source for ReplacedSource<'cfg> {
     fn download(&mut self, id: &PackageId) -> CargoResult<Package> {
         let id = id.with_source_id(&self.replace_with);
         let pkg = self.inner.download(&id).chain_err(|| {
-            format!("failed to download replaced source `{}`",
+            format!("failed to download replaced source {}",
                     self.to_replace)
         })?;
         Ok(pkg.map_source(&self.replace_with, &self.to_replace))
index 3ed4bf0d9a51f120ef7dd258ef60f7b3976bee26..9e59f4c0a1ebb806eed0a2bac341e20d7af13936 100644 (file)
@@ -62,17 +62,17 @@ fn multiple_pkgs() {
     assert_that(cargo_process("install").args(&["foo", "bar", "baz"]),
                 execs().with_status(101).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] foo v0.0.1 (registry file://[..])
+[DOWNLOADING] foo v0.0.1 (registry `file://[..]`)
 [INSTALLING] foo v0.0.1
 [COMPILING] foo v0.0.1
 [FINISHED] release [optimized] target(s) in [..]
 [INSTALLING] {home}[..]bin[..]foo[..]
-[DOWNLOADING] bar v0.0.2 (registry file://[..])
+[DOWNLOADING] bar v0.0.2 (registry `file://[..]`)
 [INSTALLING] bar v0.0.2
 [COMPILING] bar v0.0.2
 [FINISHED] release [optimized] target(s) in [..]
 [INSTALLING] {home}[..]bin[..]bar[..]
-error: could not find `baz` in `registry [..]`
+error: could not find `baz` in registry `[..]`
    
 Summary: Successfully installed foo, bar! Failed to install baz (see error(s) above).
 warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
@@ -121,7 +121,7 @@ fn missing() {
     assert_that(cargo_process("install").arg("bar"),
                 execs().with_status(101).with_stderr("\
 [UPDATING] registry [..]
-[ERROR] could not find `bar` in `registry [..]`
+[ERROR] could not find `bar` in registry `[..]`
 "));
 }
 
@@ -131,7 +131,7 @@ fn bad_version() {
     assert_that(cargo_process("install").arg("foo").arg("--vers=0.2.0"),
                 execs().with_status(101).with_stderr("\
 [UPDATING] registry [..]
-[ERROR] could not find `foo` in `registry [..]` with version `=0.2.0`
+[ERROR] could not find `foo` in registry `[..]` with version `=0.2.0`
 "));
 }
 
index 7643a92aa572604f1e44b41d9d13b54a88d14830..227289334a9fc899de66d4d58d0506b9330d2c01 100644 (file)
@@ -287,10 +287,10 @@ fn invalid_dir_bad() {
 [ERROR] failed to load source for a dependency on `foo`
 
 Caused by:
-  Unable to update registry https://[..]
+  Unable to update registry `https://[..]`
 
 Caused by:
-  failed to update replaced source `registry https://[..]`
+  failed to update replaced source registry `https://[..]`
 
 Caused by:
   local registry path is not a directory: [..]path[..]to[..]nowhere
index c63310e648694f9f6dc34088c3fea76546d1c4ed..33677bdb5bd98386ea3a46c754d2a863c9934a3a 100644 (file)
@@ -38,7 +38,7 @@ fn simple() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `{reg}`
-[DOWNLOADING] bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry `file://[..]`)
 [COMPILING] bar v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -78,8 +78,8 @@ fn deps() {
     assert_that(p.cargo_process("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `{reg}`
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
 [COMPILING] baz v0.0.1
 [COMPILING] bar v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
@@ -175,10 +175,10 @@ fn bad_cksum() {
 [ERROR] unable to get packages from source
 
 Caused by:
-  failed to download replaced source `registry https://[..]`
+  failed to download replaced source registry `https://[..]`
 
 Caused by:
-  failed to verify the checksum of `bad-cksum v0.0.1 (registry file://[..])`
+  failed to verify the checksum of `bad-cksum v0.0.1 (registry `file://[..]`)`
 "));
 }
 
@@ -210,7 +210,7 @@ version required: >= 0.0.0
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `{reg}`
-[DOWNLOADING] notyet v0.0.1 (registry file://[..])
+[DOWNLOADING] notyet v0.0.1 (registry `file://[..]`)
 [COMPILING] notyet v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -264,7 +264,7 @@ version required: ^0.0.1
 [PACKAGING] foo v0.0.1 ({dir})
 [VERIFYING] foo v0.0.1 ({dir})
 [UPDATING] registry `[..]`
-[DOWNLOADING] notyet v0.0.1 (registry file://[..])
+[DOWNLOADING] notyet v0.0.1 (registry `file://[..]`)
 [COMPILING] notyet v0.0.1
 [COMPILING] foo v0.0.1 ({dir}[..])
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -291,7 +291,7 @@ fn lockfile_locks() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry `file://[..]`)
 [COMPILING] bar v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -326,8 +326,8 @@ fn lockfile_locks_transitively() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
 [COMPILING] baz v0.0.1
 [COMPILING] bar v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
@@ -366,8 +366,8 @@ fn yanks_are_not_used() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
 [COMPILING] baz v0.0.1
 [COMPILING] bar v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
@@ -462,7 +462,7 @@ fn update_with_lockfile_if_packages_missing() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry `file://[..]`)
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
 "));
 }
@@ -501,7 +501,7 @@ fn update_lockfile() {
     println!("0.0.2 build");
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
-[DOWNLOADING] [..] v0.0.2 (registry file://[..])
+[DOWNLOADING] [..] v0.0.2 (registry `file://[..]`)
 [COMPILING] bar v0.0.2
 [COMPILING] foo v0.0.1 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -519,7 +519,7 @@ fn update_lockfile() {
     println!("0.0.3 build");
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
-[DOWNLOADING] [..] v0.0.3 (registry file://[..])
+[DOWNLOADING] [..] v0.0.3 (registry `file://[..]`)
 [COMPILING] bar v0.0.3
 [COMPILING] foo v0.0.1 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -569,7 +569,7 @@ fn dev_dependency_not_used() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] [..] v0.0.1 (registry file://[..])
+[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
 [COMPILING] bar v0.0.1
 [COMPILING] foo v0.0.1 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -652,7 +652,7 @@ fn updating_a_dep() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] bar v0.0.1 (registry file://[..])
+[DOWNLOADING] bar v0.0.1 (registry `file://[..]`)
 [COMPILING] bar v0.0.1
 [COMPILING] a v0.0.1 ({dir}/a)
 [COMPILING] foo v0.0.1 ({dir})
@@ -675,7 +675,7 @@ fn updating_a_dep() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] registry `[..]`
-[DOWNLOADING] bar v0.1.0 (registry file://[..])
+[DOWNLOADING] bar v0.1.0 (registry `file://[..]`)
 [COMPILING] bar v0.1.0
 [COMPILING] a v0.0.1 ({dir}/a)
 [COMPILING] foo v0.0.1 ({dir})
@@ -721,7 +721,7 @@ fn git_and_registry_dep() {
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] [..]
 [UPDATING] [..]
-[DOWNLOADING] a v0.0.1 (registry file://[..])
+[DOWNLOADING] a v0.0.1 (registry `file://[..]`)
 [COMPILING] a v0.0.1
 [COMPILING] b v0.0.1 ([..])
 [COMPILING] foo v0.0.1 ({dir})
@@ -787,7 +787,7 @@ fn update_publish_then_update() {
     assert_that(p.cargo("build"),
                 execs().with_status(0).with_stderr(&format!("\
 [UPDATING] [..]
-[DOWNLOADING] a v0.1.1 (registry file://[..])
+[DOWNLOADING] a v0.1.1 (registry `file://[..]`)
 [COMPILING] a v0.1.1
 [COMPILING] foo v0.5.0 ({dir})
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs
@@ -854,7 +854,7 @@ fn update_transitive_dependency() {
     assert_that(p.cargo("build"),
                 execs().with_status(0)
                        .with_stderr("\
-[DOWNLOADING] b v0.1.1 (registry file://[..])
+[DOWNLOADING] b v0.1.1 (registry `file://[..]`)
 [COMPILING] b v0.1.1
 [COMPILING] a v0.1.0
 [COMPILING] foo v0.5.0 ([..])
@@ -945,11 +945,11 @@ fn update_multiple_packages() {
     assert_that(p.cargo("build"),
                 execs().with_status(0)
                        .with_stderr_contains("\
-[DOWNLOADING] a v0.1.1 (registry file://[..])")
+[DOWNLOADING] a v0.1.1 (registry `file://[..]`)")
                        .with_stderr_contains("\
-[DOWNLOADING] b v0.1.1 (registry file://[..])")
+[DOWNLOADING] b v0.1.1 (registry `file://[..]`)")
                        .with_stderr_contains("\
-[DOWNLOADING] c v0.1.1 (registry file://[..])")
+[DOWNLOADING] c v0.1.1 (registry `file://[..]`)")
                        .with_stderr_contains("\
 [COMPILING] a v0.1.1")
                        .with_stderr_contains("\
index 2b84106a657ac3b9289a7843bfcbada6c8a4673d..31f7abaa6e41f95d1bb7f0853a68331f99d09a90 100644 (file)
@@ -376,7 +376,7 @@ fn resolving_but_no_exists() {
 
     assert_eq!(res.err().unwrap().to_string(), "\
 no matching package named `foo` found (required by `root`)
-location searched: registry http://example.com/
+location searched: registry `http://example.com/`
 version required: ^1\
 ");
 }