Prettify rustfmted single-line strings
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 14 Mar 2018 15:43:41 +0000 (18:43 +0300)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 15 Mar 2018 00:48:44 +0000 (17:48 -0700)
33 files changed:
tests/testsuite/alt_registry.rs
tests/testsuite/bad_config.rs
tests/testsuite/bad_manifest_path.rs
tests/testsuite/bench.rs
tests/testsuite/build.rs
tests/testsuite/build_auth.rs
tests/testsuite/build_script.rs
tests/testsuite/build_script_env.rs
tests/testsuite/cargo_command.rs
tests/testsuite/cargo_features.rs
tests/testsuite/check.rs
tests/testsuite/concurrent.rs
tests/testsuite/cross_compile.rs
tests/testsuite/features.rs
tests/testsuite/freshness.rs
tests/testsuite/generate_lockfile.rs
tests/testsuite/git.rs
tests/testsuite/init.rs
tests/testsuite/install.rs
tests/testsuite/local_registry.rs
tests/testsuite/metadata.rs
tests/testsuite/net_config.rs
tests/testsuite/new.rs
tests/testsuite/overrides.rs
tests/testsuite/patch.rs
tests/testsuite/registry.rs
tests/testsuite/required_features.rs
tests/testsuite/run.rs
tests/testsuite/rustdocflags.rs
tests/testsuite/rustflags.rs
tests/testsuite/search.rs
tests/testsuite/test.rs
tests/testsuite/workspaces.rs

index e9cf6ce00793f2b8cf2987e719fb181006bf4805..089dac9ce8ff4393be3a71584b126de9f26685e4 100644 (file)
@@ -410,39 +410,17 @@ fn alt_registry_and_crates_io_deps() {
         execs()
             .with_status(0)
             .with_stderr_contains(format!(
-                "\
-                 [UPDATING] registry `{}`",
+                "[UPDATING] registry `{}`",
                 registry::alt_registry()
             ))
-            .with_stderr_contains(&format!(
-                "\
-                 [UPDATING] registry `{}`",
-                registry::registry()
-            ))
-            .with_stderr_contains(
-                "\
-                 [DOWNLOADING] crates_io_dep v0.0.1 (registry `file://[..]`)",
-            )
-            .with_stderr_contains(
-                "\
-                 [DOWNLOADING] alt_reg_dep v0.1.0 (registry `file://[..]`)",
-            )
-            .with_stderr_contains(
-                "\
-                 [COMPILING] alt_reg_dep v0.1.0 (registry `file://[..]`)",
-            )
-            .with_stderr_contains(
-                "\
-                 [COMPILING] crates_io_dep v0.0.1",
-            )
-            .with_stderr_contains(&format!(
-                "\
-                 [COMPILING] foo v0.0.1 ({})",
-                p.url()
-            ))
+            .with_stderr_contains(&format!("[UPDATING] registry `{}`", registry::registry()))
+            .with_stderr_contains("[DOWNLOADING] crates_io_dep v0.0.1 (registry `file://[..]`)")
+            .with_stderr_contains("[DOWNLOADING] alt_reg_dep v0.1.0 (registry `file://[..]`)")
+            .with_stderr_contains("[COMPILING] alt_reg_dep v0.1.0 (registry `file://[..]`)")
+            .with_stderr_contains("[COMPILING] crates_io_dep v0.0.1")
+            .with_stderr_contains(&format!("[COMPILING] foo v0.0.1 ({})", p.url()))
             .with_stderr_contains(
-                "\
-                 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs",
+                "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] secs",
             ),
     )
 }
index addfc5edcc16cae641301d80a40832991567cc8d..0486297f3d3ebaf31f00c59d65e7a3de842d1117 100644 (file)
@@ -207,11 +207,9 @@ fn bad_cargo_config_jobs() {
         .build();
     assert_that(
         p.cargo("build").arg("-v"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] build.jobs must be positive, but found -1 in [..]
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] build.jobs must be positive, but found -1 in [..]"),
     );
 }
 
@@ -531,9 +529,7 @@ fn bad_crate_type() {
     assert_that(
         p.cargo("build").arg("-v"),
         execs().with_status(101).with_stderr_contains(
-            "\
-error: failed to run `rustc` to learn about target-specific information
-",
+            "error: failed to run `rustc` to learn about target-specific information",
         ),
     );
 }
@@ -1032,11 +1028,9 @@ fn bad_source_config1() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr(
-            "\
-error: no source URL specified for `source.foo`, need [..]
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: no source URL specified for `source.foo`, need [..]"),
     );
 }
 
@@ -1274,9 +1268,7 @@ fn bad_source_config6() {
     assert_that(
         p.cargo("build"),
         execs().with_status(101).with_stderr(
-            "\
-error: expected a string, but found a array for `source.crates-io.replace-with` in [..]
-",
+            "error: expected a string, but found a array for `source.crates-io.replace-with` in [..]",
         ),
     );
 }
@@ -1340,11 +1332,9 @@ fn bad_source_config7() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr(
-            "\
-error: more than one source URL specified for `source.foo`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: more than one source URL specified for `source.foo`"),
     );
 }
 
index 788c4cde4323ed685fe22e1c7e411bab87e64a73..c3fb92f065522a941b718e25f9b342b3954cd547 100644 (file)
@@ -331,8 +331,7 @@ fn verify_project_dir_containing_cargo_toml() {
             .arg("foo")
             .cwd(p.root().parent().unwrap()),
         execs().with_status(1).with_stdout(
-            "\
-             {\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
+            "{\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
              ",
         ),
     );
@@ -351,8 +350,7 @@ fn verify_project_dir_plus_file() {
             .arg("foo/bar")
             .cwd(p.root().parent().unwrap()),
         execs().with_status(1).with_stdout(
-            "\
-             {\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
+            "{\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
              ",
         ),
     );
@@ -371,8 +369,7 @@ fn verify_project_dir_plus_path() {
             .arg("foo/bar/baz")
             .cwd(p.root().parent().unwrap()),
         execs().with_status(1).with_stdout(
-            "\
-             {\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
+            "{\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
              ",
         ),
     );
@@ -387,8 +384,7 @@ fn verify_project_dir_to_nonexistent_cargo_toml() {
             .arg("foo/bar/baz/Cargo.toml")
             .cwd(p.root().parent().unwrap()),
         execs().with_status(1).with_stdout(
-            "\
-             {\"invalid\":\"manifest path `foo[..]bar[..]baz[..]Cargo.toml` does not exist\"}\
+            "{\"invalid\":\"manifest path `foo[..]bar[..]baz[..]Cargo.toml` does not exist\"}\
              ",
         ),
     );
index 30499420bb8d145b082430354d0967101428f183..ce05e1dfee32c3036cef3576e31e1b7ec59e1f71 100644 (file)
@@ -1379,15 +1379,9 @@ fn test_bench_no_fail_fast() {
             .arg("--test-threads=1"),
         execs()
             .with_status(101)
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]foo-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
             .with_stdout_contains("running 2 tests")
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]foo-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
             .with_stdout_contains("test bench_hello [..]")
             .with_stdout_contains("test bench_nope [..]"),
     );
@@ -1480,15 +1474,9 @@ fn test_bench_multiple_packages() {
         p.cargo("bench").arg("-p").arg("bar").arg("-p").arg("baz"),
         execs()
             .with_status(0)
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]bbaz-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]bbaz-[..][EXE]")
             .with_stdout_contains("test bench_baz ... bench: [..]")
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]bbar-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]bbar-[..][EXE]")
             .with_stdout_contains("test bench_bar ... bench: [..]"),
     );
 }
@@ -1563,15 +1551,9 @@ fn bench_all_workspace() {
         p.cargo("bench").arg("--all"),
         execs()
             .with_status(0)
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]bar-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]bar-[..][EXE]")
             .with_stdout_contains("test bench_bar ... bench: [..]")
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]foo-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
             .with_stdout_contains("test bench_foo ... bench: [..]"),
     );
 }
@@ -1723,15 +1705,9 @@ fn bench_all_virtual_manifest() {
         p.cargo("bench").arg("--all"),
         execs()
             .with_status(0)
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]bar-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]bar-[..][EXE]")
             .with_stdout_contains("test bench_bar ... bench: [..]")
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]foo-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
             .with_stdout_contains("test bench_foo ... bench: [..]"),
     );
 }
@@ -1855,15 +1831,9 @@ fn bench_virtual_manifest_all_implied() {
         p.cargo("bench"),
         execs()
             .with_status(0)
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]bar-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]bar-[..][EXE]")
             .with_stdout_contains("test bench_bar ... bench: [..]")
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]release[/]deps[/]foo-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]release[/]deps[/]foo-[..][EXE]")
             .with_stdout_contains("test bench_foo ... bench: [..]"),
     );
 }
index 9e28554dabf69a2eb2c86fc56b1952be950e4add..7cf2e011640c035cb33d6ee3e35683dbe3de4dbe 100644 (file)
@@ -486,11 +486,9 @@ fn cargo_compile_without_manifest() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] could not find `Cargo.toml` in `[..]` or any parent directory
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] could not find `Cargo.toml` in `[..]` or any parent directory"),
     );
 }
 
@@ -552,11 +550,9 @@ fn cargo_compile_with_warnings_in_the_root_package() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[..]function is never used: `dead`[..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[..]function is never used: `dead`[..]"),
     );
 }
 
@@ -609,11 +605,9 @@ fn cargo_compile_with_warnings_in_a_dep_package() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[..]function is never used: `dead`[..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[..]function is never used: `dead`[..]"),
     );
 
     assert_that(&p.bin("foo"), existing_file());
@@ -1010,10 +1004,9 @@ fn cargo_compile_with_filename() {
 
     assert_that(
         p.cargo("build").arg("--bin").arg("bin.rs"),
-        execs().with_status(101).with_stderr(
-            "\
-             [ERROR] no bin target named `bin.rs`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no bin target named `bin.rs`"),
     );
 
     assert_that(
@@ -1028,10 +1021,9 @@ Did you mean `a`?",
 
     assert_that(
         p.cargo("build").arg("--example").arg("example.rs"),
-        execs().with_status(101).with_stderr(
-            "\
-             [ERROR] no example target named `example.rs`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no example target named `example.rs`"),
     );
 
     assert_that(
@@ -3283,11 +3275,9 @@ fn transitive_dependencies_not_available() {
 
     assert_that(
         p.cargo("build").arg("-v"),
-        execs().with_status(101).with_stderr_contains(
-            "\
-[..] can't find crate for `bbbbb`[..]
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr_contains("[..] can't find crate for `bbbbb`[..]"),
     );
 }
 
@@ -3783,11 +3773,9 @@ fn invalid_spec() {
 
     assert_that(
         p.cargo("build").arg("-p").arg("notAValidDep"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] package id specification `notAValidDep` matched no packages
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] package id specification `notAValidDep` matched no packages"),
     );
 
     assert_that(
@@ -3796,11 +3784,9 @@ fn invalid_spec() {
             .arg("d1")
             .arg("-p")
             .arg("notAValidDep"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] package id specification `notAValidDep` matched no packages
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] package id specification `notAValidDep` matched no packages"),
     );
 }
 
@@ -5032,9 +5018,7 @@ fn inferred_bins_duplicate_name() {
     assert_that(
         p.cargo("build"),
         execs().with_status(101).with_stderr_contains(
-            "\
-[..]found duplicate binary name foo, but all binary targets must have a unique name[..]
-",
+            "[..]found duplicate binary name foo, but all binary targets must have a unique name[..]",
         ),
     );
 }
@@ -5320,8 +5304,7 @@ fn build_filter_infer_profile() {
                  --emit=dep-info,link[..]",
             )
             .with_stderr_contains(
-                "\
-                 [RUNNING] `rustc --crate-name t1 tests[/]t1.rs --emit=dep-info,link[..]",
+                "[RUNNING] `rustc --crate-name t1 tests[/]t1.rs --emit=dep-info,link[..]",
             )
             .with_stderr_contains(
                 "\
@@ -5463,10 +5446,8 @@ fn invalid_jobs() {
 
     assert_that(
         p.cargo("build").arg("--jobs").arg("over9000"),
-        execs().with_status(1).with_stderr(
-            "\
-error: Invalid value: could not parse `over9000` as a number
-",
-        ),
+        execs()
+            .with_status(1)
+            .with_stderr("error: Invalid value: could not parse `over9000` as a number"),
     );
 }
index 40caa79035e46983dd83f35c4cb4e46ff6303d2d..01df880360b0f2199c9709d6d719bc67b67b5894 100644 (file)
@@ -198,9 +198,7 @@ fn https_something_happens() {
         execs()
             .with_status(101)
             .with_stderr_contains(&format!(
-                "\
-[UPDATING] git repository `https://{addr}/foo/bar`
-",
+                "[UPDATING] git repository `https://{addr}/foo/bar`",
                 addr = addr
             ))
             .with_stderr_contains(&format!(
@@ -257,9 +255,7 @@ fn ssh_something_happens() {
         execs()
             .with_status(101)
             .with_stderr_contains(&format!(
-                "\
-[UPDATING] git repository `ssh://{addr}/foo/bar`
-",
+                "[UPDATING] git repository `ssh://{addr}/foo/bar`",
                 addr = addr
             ))
             .with_stderr_contains(
index 97a363bf2d3456652822391a644da614372f1df6..59aee06324a15c1b26a1c35ccca7557d7aab4dd5 100644 (file)
@@ -985,11 +985,7 @@ fn build_deps_not_for_normal() {
         p.cargo("build").arg("-v").arg("--target").arg(&target),
         execs()
             .with_status(101)
-            .with_stderr_contains(
-                "\
-[..]can't find crate for `aaaaa`[..]
-",
-            )
+            .with_stderr_contains("[..]can't find crate for `aaaaa`[..]")
             .with_stderr_contains(
                 "\
 [ERROR] Could not compile `foo`.
@@ -1276,11 +1272,7 @@ fn code_generation() {
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
 [RUNNING] `target[/]debug[/]foo`",
             )
-            .with_stdout(
-                "\
-Hello, World!
-",
-            ),
+            .with_stdout("Hello, World!"),
     );
 
     assert_that(p.cargo("test"), execs().with_status(0));
@@ -2806,9 +2798,7 @@ fn doctest_recieves_build_link_args() {
     assert_that(
         p.cargo("test").arg("-v"),
         execs().with_status(0).with_stderr_contains(
-            "\
-[RUNNING] `rustdoc --test [..] --crate-name foo [..]-L native=bar[..]`
-",
+            "[RUNNING] `rustdoc --test [..] --crate-name foo [..]-L native=bar[..]`",
         ),
     );
 }
@@ -2862,11 +2852,9 @@ fn please_respect_the_dag() {
 
     assert_that(
         p.cargo("build").arg("-v"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[RUNNING] `rustc [..] -L native=foo -L native=bar[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[RUNNING] `rustc [..] -L native=foo -L native=bar[..]`"),
     );
 }
 
@@ -3201,15 +3189,8 @@ fn output_shows_on_vv() {
 
     assert_that(
         p.cargo("build").arg("-vv"),
-        execs()
-            .with_status(0)
-            .with_stdout(
-                "\
-stdout
-",
-            )
-            .with_stderr(
-                "\
+        execs().with_status(0).with_stdout("stdout").with_stderr(
+            "\
 [COMPILING] foo v0.5.0 ([..])
 [RUNNING] `rustc [..]`
 [RUNNING] `[..]`
@@ -3217,7 +3198,7 @@ stderr
 [RUNNING] `rustc [..]`
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
 ",
-            ),
+        ),
     );
 }
 
@@ -3260,11 +3241,9 @@ fn links_with_dots() {
 
     assert_that(
         p.cargo("build").arg("-v"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[RUNNING] `rustc --crate-name foo [..] [..] -L foo[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[RUNNING] `rustc --crate-name foo [..] [..] -L foo[..]`"),
     );
 }
 
index 494f1948cbba95dda0430193305bd8fd6fb14cc7..382ef2585d75b1ec7905f9930f819afe7eabfa0d 100644 (file)
@@ -61,11 +61,7 @@ fn rerun_if_env_changes() {
     );
     assert_that(
         p.cargo("build").env("FOO", "baz"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
     assert_that(
         p.cargo("build"),
@@ -128,11 +124,7 @@ fn rerun_if_env_or_file_changes() {
     );
     assert_that(
         p.cargo("build").env("FOO", "bar"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
     sleep_ms(1000);
     File::create(p.root().join("foo")).unwrap();
index 3164e6c2a2b9c14dcd6ae987c7b47b716aef7b12..d0574a6d8aa0af374ecc132ab6af599b1bc63f01 100644 (file)
@@ -256,8 +256,7 @@ fn explain() {
     assert_that(
         cargo_process().arg("--explain").arg("E0001"),
         execs().with_status(0).with_stdout_contains(
-            "\
-             This error suggests that the expression arm corresponding to the noted pattern",
+            "This error suggests that the expression arm corresponding to the noted pattern",
         ),
     );
 }
index a4c9637ca066a8d86a57cbf33bfe06bf3c7cb249..82de8867666983f31bdd34dd47e48566c6e7cdf6 100644 (file)
@@ -274,20 +274,16 @@ fn z_flags_rejected() {
         .build();
     assert_that(
         p.cargo("build").arg("-Zprint-im-a-teapot"),
-        execs().with_status(101).with_stderr(
-            "\
-error: the `-Z` flag is only accepted on the nightly channel of Cargo
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: the `-Z` flag is only accepted on the nightly channel of Cargo"),
     );
 
     assert_that(
         p.cargo("build").masquerade_as_nightly_cargo().arg("-Zarg"),
-        execs().with_status(101).with_stderr(
-            "\
-error: unknown `-Z` flag specified: arg
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: unknown `-Z` flag specified: arg"),
     );
 
     assert_that(
@@ -325,9 +321,7 @@ fn publish_rejected() {
     assert_that(
         p.cargo("publish").masquerade_as_nightly_cargo(),
         execs().with_status(101).with_stderr(
-            "\
-error: cannot publish crates which activate nightly-only cargo features to crates.io
-",
+            "error: cannot publish crates which activate nightly-only cargo features to crates.io",
         ),
     );
 }
index 1ff619b0e2d928127abf1159d365b9a14e14ecfd..7499f136d776b86d51ba60f2326af1e6b696c410 100644 (file)
@@ -399,11 +399,9 @@ fn dylib_check_preserves_build_cache() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 }
 
index fb0a05247d9b6ddd29a9456b88ed255a1ece7c35..9c777e2cc8a308081597cb787ef1a4d930b18b16 100644 (file)
@@ -145,18 +145,14 @@ fn one_install_should_be_bad() {
     assert_that(
         bad,
         execs().with_status(101).with_stderr_contains(
-            "\
-[ERROR] binary `foo[..]` already exists in destination as part of `[..]`
-",
+            "[ERROR] binary `foo[..]` already exists in destination as part of `[..]`",
         ),
     );
     assert_that(
         good,
-        execs().with_status(0).with_stderr_contains(
-            "\
-warning: be sure to add `[..]` to your PATH [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("warning: be sure to add `[..]` to your PATH [..]"),
     );
 
     assert_that(cargo_home(), has_installed_exe("foo"));
index 97e81e6dd59b3949aa10c591b778e940dfcf3cf6..c17a6fd71f91c190d72ede3c3a65a87acd144a15 100644 (file)
@@ -872,25 +872,20 @@ fn build_script_needed_for_host_and_target() {
         execs()
             .with_status(0)
             .with_stderr_contains(&format!(
-                "\
-                 [COMPILING] d1 v0.0.0 ({url}/d1)",
+                "[COMPILING] d1 v0.0.0 ({url}/d1)",
                 url = p.url()
             ))
-            .with_stderr_contains(&format!("\
-[RUNNING] `rustc [..] d1[/]build.rs [..] --out-dir {dir}[/]target[/]debug[/]build[/]d1-[..]`",
+            .with_stderr_contains(&format!("[RUNNING] `rustc [..] d1[/]build.rs [..] --out-dir {dir}[/]target[/]debug[/]build[/]d1-[..]`",
     dir = p.root().display()))
             .with_stderr_contains(&format!(
-                "\
-                 [RUNNING] `{dir}[/]target[/]debug[/]build[/]d1-[..][/]build-script-build`",
+                "[RUNNING] `{dir}[/]target[/]debug[/]build[/]d1-[..][/]build-script-build`",
                 dir = p.root().display()
             ))
             .with_stderr_contains(
-                "\
-                 [RUNNING] `rustc [..] d1[/]src[/]lib.rs [..]`",
+                "[RUNNING] `rustc [..] d1[/]src[/]lib.rs [..]`",
             )
             .with_stderr_contains(&format!(
-                "\
-                 [COMPILING] d2 v0.0.0 ({url}/d2)",
+                "[COMPILING] d2 v0.0.0 ({url}/d2)",
                 url = p.url()
             ))
             .with_stderr_contains(&format!(
@@ -900,8 +895,7 @@ fn build_script_needed_for_host_and_target() {
                 host = host
             ))
             .with_stderr_contains(&format!(
-                "\
-                 [COMPILING] foo v0.0.0 ({url})",
+                "[COMPILING] foo v0.0.0 ({url})",
                 url = p.url()
             ))
             .with_stderr_contains(&format!("\
@@ -1217,10 +1211,9 @@ fn platform_specific_dependencies_do_not_leak() {
 
     assert_that(
         p.cargo("build").arg("-v").arg("--target").arg(&target),
-        execs().with_status(101).with_stderr_contains(
-            "\
-             [..] can't find crate for `d2`[..]",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr_contains("[..] can't find crate for `d2`[..]"),
     );
 }
 
index 7fbf3fc3218f800881a36953d1bcbfc0e25d2f2c..f877d3ea5614187ee9e530f556afa2336ac160a7 100644 (file)
@@ -161,10 +161,9 @@ failed to select a version for `bar` which could resolve this conflict",
 
     assert_that(
         p.cargo("build").arg("--features").arg("test"),
-        execs().with_status(101).with_stderr(
-            "\
-             error: Package `foo v0.0.1 ([..])` does not have these features: `test`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: Package `foo v0.0.1 ([..])` does not have these features: `test`"),
     );
 }
 
@@ -294,11 +293,9 @@ fn invalid8() {
 
     assert_that(
         p.cargo("build").arg("--features").arg("foo"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] feature names may not contain slashes: `foo/bar`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] feature names may not contain slashes: `foo/bar`"),
     );
 }
 
@@ -459,11 +456,9 @@ fn no_transitive_dep_feature_requirement() {
         .build();
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] feature names may not contain slashes: `bar/qux`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] feature names may not contain slashes: `bar/qux`"),
     );
 }
 
@@ -632,11 +627,9 @@ fn cyclic_feature() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] Cyclic feature dependency: feature `default` depends on itself
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] Cyclic feature dependency: feature `default` depends on itself"),
     );
 }
 
@@ -1399,10 +1392,9 @@ fn dep_feature_in_cmd_line() {
     // Trying to enable features of transitive dependencies is an error
     assert_that(
         p.cargo("build").arg("--features").arg("bar/some-feat"),
-        execs().with_status(101).with_stderr(
-            "\
-             error: Package `foo v0.0.1 ([..])` does not have these features: `bar`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: Package `foo v0.0.1 ([..])` does not have these features: `bar`"),
     );
 
     // Hierarchical feature specification should still be disallowed
@@ -1410,11 +1402,9 @@ fn dep_feature_in_cmd_line() {
         p.cargo("build")
             .arg("--features")
             .arg("derived/bar/some-feat"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] feature names may not contain slashes: `bar/some-feat`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] feature names may not contain slashes: `bar/some-feat`"),
     );
 }
 
index 55e15e9f2f20b1588be11e1b3e8ba8e3f282b142..246533821ae676d01b74966f4eff872a2ba2416b 100644 (file)
@@ -239,22 +239,18 @@ fn changing_lib_features_caches_targets() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 
     assert_that(p.cargo("build"), execs().with_status(0).with_stdout(""));
 
     assert_that(
         p.cargo("build").arg("--features").arg("foo"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 }
 
@@ -305,11 +301,9 @@ fn changing_profiles_caches_targets() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 
     assert_that(
@@ -854,11 +848,10 @@ fn no_rebuild_if_build_artifacts_move_backwards_in_time() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stdout("").with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stdout("")
+            .with_stderr("[FINISHED] [..]"),
     );
 }
 
@@ -1009,10 +1002,8 @@ fn no_rebuild_when_rename_dir() {
 
     assert_that(
         p.cargo("build").cwd(&new),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 }
index 0f499d688b3e298f1cf7654209f11b60741dea39..6018904f03fab97c09e20282b7d9996103416e29 100644 (file)
@@ -112,11 +112,7 @@ fn no_index_update() {
 
     assert_that(
         p.cargo("generate-lockfile"),
-        execs().with_stderr(
-            "\
-[UPDATING] registry `[..]`
-",
-        ),
+        execs().with_stderr("[UPDATING] registry `[..]`"),
     );
 
     assert_that(
index e93ee7c66fd708ba049dca2878ff07b383107add..d764cc2a3d8fba446608b50eb823224ad6782e7f 100644 (file)
@@ -2067,9 +2067,7 @@ fn fetch_downloads() {
     assert_that(
         p.cargo("fetch"),
         execs().with_status(0).with_stderr(&format!(
-            "\
-[UPDATING] git repository `{url}`
-",
+            "[UPDATING] git repository `{url}`",
             url = bar.url()
         )),
     );
@@ -2260,12 +2258,9 @@ fn update_one_dep_in_repo_with_many_deps() {
     assert_that(p.cargo("generate-lockfile"), execs().with_status(0));
     assert_that(
         p.cargo("update").arg("-p").arg("foo"),
-        execs().with_status(0).with_stderr(&format!(
-            "\
-[UPDATING] git repository `{}`
-",
-            foo.url()
-        )),
+        execs()
+            .with_status(0)
+            .with_stderr(&format!("[UPDATING] git repository `{}`", foo.url())),
     );
 }
 
index 431b47eac4d6e2e51bdf800f3b057de7c1565bf2..2db179f721877b523b78d180cb21ebaff9c67b9d 100644 (file)
@@ -22,11 +22,9 @@ fn simple_lib() {
             .arg("--vcs")
             .arg("none")
             .env("USER", "foo"),
-        execs().with_status(0).with_stderr(
-            "\
-[CREATED] library project
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[CREATED] library project"),
     );
 
     assert_that(&paths::root().join("Cargo.toml"), existing_file());
@@ -47,11 +45,9 @@ fn simple_bin() {
             .arg("none")
             .env("USER", "foo")
             .cwd(&path),
-        execs().with_status(0).with_stderr(
-            "\
-[CREATED] binary (application) project
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[CREATED] binary (application) project"),
     );
 
     assert_that(&paths::root().join("foo/Cargo.toml"), existing_file());
@@ -200,9 +196,7 @@ fn confused_by_multiple_lib_files() {
             .env("USER", "foo")
             .cwd(&path),
         execs().with_status(101).with_stderr(
-            "\
-[ERROR] cannot have a project with multiple libraries, found both `src/lib.rs` and `lib.rs`
-",
+            "[ERROR] cannot have a project with multiple libraries, found both `src/lib.rs` and `lib.rs`",
         ),
     );
 
@@ -608,9 +602,7 @@ fn unknown_flags() {
     assert_that(
         cargo_process("init").arg("foo").arg("--flag"),
         execs().with_status(1).with_stderr_contains(
-            "\
-error: Found argument '--flag' which wasn't expected, or isn't valid in this context
-",
+            "error: Found argument '--flag' which wasn't expected, or isn't valid in this context",
         ),
     );
 }
@@ -621,9 +613,7 @@ fn no_filename() {
     assert_that(
         cargo_process("init").arg("/"),
         execs().with_status(101).with_stderr(
-            "\
-[ERROR] cannot auto-detect project name from path \"/\" ; use --name to override
-"
+            "[ERROR] cannot auto-detect project name from path \"/\" ; use --name to override"
                 .to_string(),
         ),
     );
index 5b2fc6e869d16e27aa2a12872d7055f54757efca..b3e5c5bf368dbbfbfb1c5b77f6c15ae3a9f44064 100644 (file)
@@ -56,9 +56,7 @@ warning: be sure to add `[..]` to your PATH to be able to run the installed bina
     assert_that(
         cargo_process("uninstall").arg("foo"),
         execs().with_status(0).with_stderr(&format!(
-            "\
-[REMOVING] {home}[..]bin[..]foo[..]
-",
+            "[REMOVING] {home}[..]bin[..]foo[..]",
             home = cargo_home().display()
         )),
     );
@@ -472,11 +470,9 @@ fn no_binaries_or_examples() {
 
     assert_that(
         cargo_process("install").arg("--path").arg(p.root()),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] no packages found with binaries or examples
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no packages found with binaries or examples"),
     );
 }
 
@@ -905,11 +901,9 @@ Caused by:
 fn uninstall_pkg_does_not_exist() {
     assert_that(
         cargo_process("uninstall").arg("foo"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] package id specification `foo` matched no packages
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] package id specification `foo` matched no packages"),
     );
 }
 
@@ -920,11 +914,9 @@ fn uninstall_bin_does_not_exist() {
     assert_that(cargo_process("install").arg("foo"), execs().with_status(0));
     assert_that(
         cargo_process("uninstall").arg("foo").arg("--bin=bar"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] binary `bar[..]` not installed as part of `foo v0.0.1`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] binary `bar[..]` not installed as part of `foo v0.0.1`"),
     );
 }
 
@@ -953,11 +945,7 @@ fn uninstall_piecemeal() {
 
     assert_that(
         cargo_process("uninstall").arg("foo").arg("--bin=bar"),
-        execs().with_status(0).with_stderr(
-            "\
-[REMOVING] [..]bar[..]
-",
-        ),
+        execs().with_status(0).with_stderr("[REMOVING] [..]bar[..]"),
     );
 
     assert_that(cargo_home(), has_installed_exe("foo"));
@@ -965,21 +953,15 @@ fn uninstall_piecemeal() {
 
     assert_that(
         cargo_process("uninstall").arg("foo").arg("--bin=foo"),
-        execs().with_status(0).with_stderr(
-            "\
-[REMOVING] [..]foo[..]
-",
-        ),
+        execs().with_status(0).with_stderr("[REMOVING] [..]foo[..]"),
     );
     assert_that(cargo_home(), is_not(has_installed_exe("foo")));
 
     assert_that(
         cargo_process("uninstall").arg("foo"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] package id specification `foo` matched no packages
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] package id specification `foo` matched no packages"),
     );
 }
 
@@ -1085,11 +1067,9 @@ fn reports_unsuccessful_subcommand_result() {
     );
     assert_that(
         cargo_process("fail"),
-        execs().with_status(101).with_stderr_contains(
-            "\
-thread '[..]' panicked at 'explicit panic', [..]
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr_contains("thread '[..]' panicked at 'explicit panic', [..]"),
     );
 }
 
@@ -1294,11 +1274,9 @@ fn vers_precise() {
             .arg("foo")
             .arg("--vers")
             .arg("0.1.1"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[DOWNLOADING] foo v0.1.1 (registry [..])
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[DOWNLOADING] foo v0.1.1 (registry [..])"),
     );
 }
 
@@ -1312,11 +1290,9 @@ fn version_too() {
             .arg("foo")
             .arg("--version")
             .arg("0.1.1"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-                    [DOWNLOADING] foo v0.1.1 (registry [..])
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[DOWNLOADING] foo v0.1.1 (registry [..])"),
     );
 }
 
@@ -1361,17 +1337,13 @@ and will continue to do so, but this behavior will be removed eventually
 #[test]
 fn test_install_git_cannot_be_a_base_url() {
     assert_that(cargo_process("install").arg("--git").arg("github.com:rust-lang-nursery/rustfmt.git"),
-                execs().with_status(101).with_stderr("\
-error: invalid url `github.com:rust-lang-nursery/rustfmt.git`: cannot-be-a-base-URLs are not supported
-"));
+                execs().with_status(101).with_stderr("error: invalid url `github.com:rust-lang-nursery/rustfmt.git`: cannot-be-a-base-URLs are not supported"));
 }
 
 #[test]
 fn uninstall_multiple_and_specifying_bin() {
     assert_that(cargo_process("uninstall").args(&["foo", "bar"]).arg("--bin").arg("baz"),
-                execs().with_status(101).with_stderr("\
-error: A binary can only be associated with a single installed package, specifying multiple specs with --bin is redundant.
-"));
+                execs().with_status(101).with_stderr("error: A binary can only be associated with a single installed package, specifying multiple specs with --bin is redundant."));
 }
 
 #[test]
index 6d51b3d5d9546f478f3d7d8fd479a427075f12ad..4f73d43dea0047d127c41fc310b1155b420d5b72 100644 (file)
@@ -67,11 +67,7 @@ fn simple() {
     );
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
     assert_that(p.cargo("test"), execs().with_status(0));
 }
@@ -129,11 +125,9 @@ fn multiple_versions() {
 
     assert_that(
         p.cargo("update").arg("-v"),
-        execs().with_status(0).with_stderr(
-            "\
-[UPDATING] foo v0.1.0 -> v0.2.0
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[UPDATING] foo v0.1.0 -> v0.2.0"),
     );
 }
 
@@ -491,11 +485,7 @@ fn crates_io_registry_url_is_optional() {
     );
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
     assert_that(p.cargo("test"), execs().with_status(0));
 }
index e3315f9a4a3ba1a719e404ffbf247b2ac11afc6c..4a2154bd9309187653b10de092e37469a5f951b9 100644 (file)
@@ -67,8 +67,7 @@ fn cargo_metadata_warns_on_implicit_version() {
         .build();
 
     assert_that(p.cargo("metadata"),
-                execs().with_stderr("\
-[WARNING] please specify `--format-version` flag explicitly to avoid compatibility problems"));
+                execs().with_stderr("[WARNING] please specify `--format-version` flag explicitly to avoid compatibility problems"));
 
     assert_that(
         p.cargo("metadata").arg("--format-version").arg("1"),
index 546489664dafd6034806daa241cc88d9bc9486e4..46417ca694a4da7152f7493402c314fee9bdc7ea 100644 (file)
@@ -70,9 +70,6 @@ fn net_retry_git_outputs_warning() {
                 "[WARNING] spurious network error \
                  (2 tries remaining): [..]",
             )
-            .with_stderr_contains(
-                "\
-                 [WARNING] spurious network error (1 tries remaining): [..]",
-            ),
+            .with_stderr_contains("[WARNING] spurious network error (1 tries remaining): [..]"),
     );
 }
index eb25a0bbce69a2591c156c1b918c6596dcc15074..64057a058cfa70f553536afbaa61fc008a33b984 100644 (file)
@@ -31,11 +31,9 @@ fn simple_lib() {
             .arg("--vcs")
             .arg("none")
             .env("USER", "foo"),
-        execs().with_status(0).with_stderr(
-            "\
-[CREATED] library `foo` project
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[CREATED] library `foo` project"),
     );
 
     assert_that(&paths::root().join("foo"), existing_dir());
@@ -77,11 +75,9 @@ fn simple_bin() {
             .arg("--bin")
             .arg("foo")
             .env("USER", "foo"),
-        execs().with_status(0).with_stderr(
-            "\
-[CREATED] binary (application) `foo` project
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[CREATED] binary (application) `foo` project"),
     );
 
     assert_that(&paths::root().join("foo"), existing_dir());
@@ -532,9 +528,7 @@ fn unknown_flags() {
     assert_that(
         cargo_process("new").arg("foo").arg("--flag"),
         execs().with_status(1).with_stderr_contains(
-            "\
-error: Found argument '--flag' which wasn't expected, or isn't valid in this context
-",
+            "error: Found argument '--flag' which wasn't expected, or isn't valid in this context",
         ),
     );
 }
@@ -547,8 +541,7 @@ fn explicit_invalid_name_not_suggested() {
             .arg("10-invalid")
             .arg("a"),
         execs().with_status(101).with_stderr(
-            "\
-             [ERROR] Package names starting with a digit cannot be used as a crate name",
+            "[ERROR] Package names starting with a digit cannot be used as a crate name",
         ),
     );
 }
index 75660e85b901dd1d48f43f5f440132375d7ae93d..79a122447e78bd624cfdb2eb2135d27955aa0b10 100644 (file)
@@ -498,21 +498,17 @@ fn override_adds_some_deps() {
         p.cargo("update")
             .arg("-p")
             .arg(&format!("{}#bar", foo.url())),
-        execs().with_status(0).with_stderr(
-            "\
-[UPDATING] git repository `file://[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[UPDATING] git repository `file://[..]`"),
     );
     assert_that(
         p.cargo("update")
             .arg("-p")
             .arg("https://github.com/rust-lang/crates.io-index#bar"),
-        execs().with_status(0).with_stderr(
-            "\
-[UPDATING] registry `file://[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[UPDATING] registry `file://[..]`"),
     );
 
     assert_that(p.cargo("build"), execs().with_status(0).with_stdout(""));
@@ -1619,10 +1615,8 @@ fn override_plus_dep() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr_contains(
-            "\
-error: cyclic package dependency: [..]
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr_contains("error: cyclic package dependency: [..]"),
     );
 }
index 79b96fc4f47593251743f4d42ddb10901b8300b4..2e47ba84f08b64f9b7c0acf9f5406e864ab60d82 100644 (file)
@@ -564,11 +564,9 @@ fn add_ignored_patch() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
     assert_that(
         p.cargo("build"),
@@ -731,11 +729,9 @@ fn new_major() {
     assert_that(p.cargo("update"), execs().with_status(0));
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 
     t!(t!(File::create(p.root().join("Cargo.toml"))).write_all(
@@ -1046,11 +1042,7 @@ fn patch_in_virtual() {
     assert_that(p.cargo("build"), execs().with_status(0));
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
 }
 
@@ -1114,10 +1106,6 @@ fn patch_depends_on_another_patch() {
     // Nothing should be rebuilt, no registry should be updated.
     assert_that(
         p.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
 }
index 3d2b81fc536f6d640db48092a69cb730418ce3bc..49a6ab90b4fb8ae5a6c1b55ed53eef0f77013672 100644 (file)
@@ -810,10 +810,9 @@ fn bad_license_file() {
             .arg("-v")
             .arg("--index")
             .arg(registry().to_string()),
-        execs().with_status(101).with_stderr_contains(
-            "\
-             [ERROR] the license file `foo` does not exist",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr_contains("[ERROR] the license file `foo` does not exist"),
     );
 }
 
@@ -1150,11 +1149,9 @@ fn update_backtracking_ok() {
 
     assert_that(
         p.cargo("update").arg("-p").arg("hyper"),
-        execs().with_status(0).with_stderr(
-            "\
-[UPDATING] registry `[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[UPDATING] registry `[..]`"),
     );
 }
 
@@ -1213,34 +1210,13 @@ fn update_multiple_packages() {
         p.cargo("build"),
         execs()
             .with_status(0)
-            .with_stderr_contains(
-                "\
-                 [DOWNLOADING] a v0.1.1 (registry `file://[..]`)",
-            )
-            .with_stderr_contains(
-                "\
-                 [DOWNLOADING] b v0.1.1 (registry `file://[..]`)",
-            )
-            .with_stderr_contains(
-                "\
-                 [DOWNLOADING] c v0.1.1 (registry `file://[..]`)",
-            )
-            .with_stderr_contains(
-                "\
-                 [COMPILING] a v0.1.1",
-            )
-            .with_stderr_contains(
-                "\
-                 [COMPILING] b v0.1.1",
-            )
-            .with_stderr_contains(
-                "\
-                 [COMPILING] c v0.1.1",
-            )
-            .with_stderr_contains(
-                "\
-                 [COMPILING] foo v0.5.0 ([..])",
-            ),
+            .with_stderr_contains("[DOWNLOADING] a v0.1.1 (registry `file://[..]`)")
+            .with_stderr_contains("[DOWNLOADING] b v0.1.1 (registry `file://[..]`)")
+            .with_stderr_contains("[DOWNLOADING] c v0.1.1 (registry `file://[..]`)")
+            .with_stderr_contains("[COMPILING] a v0.1.1")
+            .with_stderr_contains("[COMPILING] b v0.1.1")
+            .with_stderr_contains("[COMPILING] c v0.1.1")
+            .with_stderr_contains("[COMPILING] foo v0.5.0 ([..])"),
     );
 }
 
@@ -1437,11 +1413,9 @@ fn upstream_warnings_on_extra_verbose() {
 
     assert_that(
         p.cargo("build").arg("-vv"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[..]warning: function is never used[..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[..]warning: function is never used[..]"),
     );
 }
 
index 19737b3e6dc8650a6512e6dc3580f858ff730d62..93ee37780ab5a7d851aa9e2c5706e0d609a36cf9 100644 (file)
@@ -354,8 +354,7 @@ fn test_default_features() {
         execs()
             .with_status(0)
             .with_stderr(format!(
-                "\
-                 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
+                "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
             ))
             .with_stdout(""),
     );
@@ -486,8 +485,7 @@ fn test_multiple_required_features() {
         execs()
             .with_status(0)
             .with_stderr(format!(
-                "\
-                 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
+                "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
             ))
             .with_stdout(""),
     );
@@ -547,10 +545,7 @@ fn bench_default_features() {
         p.cargo("bench").arg("--no-default-features"),
         execs()
             .with_status(0)
-            .with_stderr(format!(
-                "\
-                 [FINISHED] release [optimized] target(s) in [..]"
-            ))
+            .with_stderr(format!("[FINISHED] release [optimized] target(s) in [..]"))
             .with_stdout(""),
     );
 
@@ -714,10 +709,7 @@ fn bench_multiple_required_features() {
         p.cargo("bench").arg("--no-default-features"),
         execs()
             .with_status(0)
-            .with_stderr(format!(
-                "\
-                 [FINISHED] release [optimized] target(s) in [..]"
-            ))
+            .with_stderr(format!("[FINISHED] release [optimized] target(s) in [..]"))
             .with_stdout(""),
     );
 }
@@ -1121,8 +1113,7 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
         execs()
             .with_status(0)
             .with_stderr(format!(
-                "\
-                 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
+                "[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
             ))
             .with_stdout(""),
     );
@@ -1150,10 +1141,7 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
             p.cargo("bench"),
             execs()
                 .with_status(0)
-                .with_stderr(format!(
-                    "\
-                     [FINISHED] release [optimized] target(s) in [..]"
-                ))
+                .with_stderr(format!("[FINISHED] release [optimized] target(s) in [..]"))
                 .with_stdout(""),
         );
 
index e1f93ed236fbbc5d27e60daac763da9e183fc159..2c298aaef0003e1531441d5000e6d0c5f558a345 100644 (file)
@@ -33,11 +33,7 @@ fn simple() {
 [RUNNING] `target[/]debug[/]foo[EXE]`",
                 dir = path2url(p.root())
             ))
-            .with_stdout(
-                "\
-hello
-",
-            ),
+            .with_stdout("hello"),
     );
     assert_that(&p.bin("foo"), existing_file());
 }
@@ -95,11 +91,9 @@ fn simple_quiet_and_verbose() {
 
     assert_that(
         p.cargo("run").arg("-q").arg("-v"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] cannot set both --verbose and --quiet
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] cannot set both --verbose and --quiet"),
     );
 }
 
@@ -191,9 +185,7 @@ fn exit_code() {
     );
     if !cfg!(unix) {
         output.push_str(
-            "\
-[ERROR] process didn't exit successfully: `target[..]foo[..]` (exit code: 2)
-",
+            "[ERROR] process didn't exit successfully: `target[..]foo[..]` (exit code: 2)",
         );
     }
     assert_that(p.cargo("run"), execs().with_status(2).with_stderr(output));
@@ -229,9 +221,7 @@ fn exit_code_verbose() {
     );
     if !cfg!(unix) {
         output.push_str(
-            "\
-[ERROR] process didn't exit successfully: `target[..]foo[..]` (exit code: 2)
-",
+            "[ERROR] process didn't exit successfully: `target[..]foo[..]` (exit code: 2)",
         );
     }
 
@@ -336,11 +326,7 @@ fn specify_name() {
 [RUNNING] `target[/]debug[/]a[EXE]`",
                 dir = path2url(p.root())
             ))
-            .with_stdout(
-                "\
-hello a.rs
-",
-            ),
+            .with_stdout("hello a.rs"),
     );
 
     assert_that(
@@ -354,11 +340,7 @@ hello a.rs
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
 [RUNNING] `target[/]debug[/]b[EXE]`",
             )
-            .with_stdout(
-                "\
-hello b.rs
-",
-            ),
+            .with_stdout("hello b.rs"),
     );
 }
 
@@ -400,11 +382,7 @@ fn run_example() {
 [RUNNING] `target[/]debug[/]examples[/]a[EXE]`",
                 dir = path2url(p.root())
             ))
-            .with_stdout(
-                "\
-example
-",
-            ),
+            .with_stdout("example"),
     );
 }
 
@@ -438,8 +416,7 @@ fn run_bins() {
     assert_that(
         p.cargo("run").arg("--bins"),
         execs().with_status(1).with_stderr_contains(
-            "\
-             error: Found argument '--bins' which wasn't expected, or isn't valid in this context",
+            "error: Found argument '--bins' which wasn't expected, or isn't valid in this context",
         ),
     );
 }
@@ -474,10 +451,9 @@ fn run_with_filename() {
 
     assert_that(
         p.cargo("run").arg("--bin").arg("bin.rs"),
-        execs().with_status(101).with_stderr(
-            "\
-             [ERROR] no bin target named `bin.rs`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no bin target named `bin.rs`"),
     );
 
     assert_that(
@@ -492,10 +468,9 @@ Did you mean `a`?",
 
     assert_that(
         p.cargo("run").arg("--example").arg("example.rs"),
-        execs().with_status(101).with_stderr(
-            "\
-             [ERROR] no example target named `example.rs`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no example target named `example.rs`"),
     );
 
     assert_that(
@@ -593,11 +568,7 @@ fn one_bin_multiple_examples() {
 [RUNNING] `target[/]debug[/]main[EXE]`",
                 dir = path2url(p.root())
             ))
-            .with_stdout(
-                "\
-hello main.rs
-",
-            ),
+            .with_stdout("hello main.rs"),
     );
 }
 
@@ -901,11 +872,7 @@ fn run_from_executable_folder() {
                  [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n\
                  [RUNNING] `.[/]foo[EXE]`",
             )
-            .with_stdout(
-                "\
-hello
-",
-            ),
+            .with_stdout("hello"),
     );
 }
 
@@ -1133,9 +1100,7 @@ fn run_multiple_packages() {
     assert_that(cargo().arg("-p").arg("d1").arg("-p").arg("d2"),
                 execs()
                     .with_status(1)
-                    .with_stderr_contains("\
-error: The argument '--package <SPEC>' was provided more than once, but cannot be used multiple times
-"));
+                    .with_stderr_contains("error: The argument '--package <SPEC>' was provided more than once, but cannot be used multiple times"));
 
     assert_that(
         cargo().arg("-p").arg("d3"),
index 9a22b1683c315399b633c916cb2510c54328e400..3102d2408968b145307aa9dc379b7c1bb7c73d5c 100644 (file)
@@ -18,11 +18,9 @@ fn parses_env() {
 
     assert_that(
         p.cargo("doc").env("RUSTDOCFLAGS", "--cfg=foo").arg("-v"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[RUNNING] `rustdoc [..] --cfg=foo[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[RUNNING] `rustdoc [..] --cfg=foo[..]`"),
     );
 }
 
@@ -50,11 +48,9 @@ fn parses_config() {
 
     assert_that(
         p.cargo("doc").arg("-v"),
-        execs().with_status(0).with_stderr_contains(
-            "\
-[RUNNING] `rustdoc [..] --cfg foo[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[RUNNING] `rustdoc [..] --cfg foo[..]`"),
     );
 }
 
@@ -100,11 +96,9 @@ fn rerun() {
     );
     assert_that(
         p.cargo("doc").env("RUSTDOCFLAGS", "--cfg=foo"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
     assert_that(
         p.cargo("doc").env("RUSTDOCFLAGS", "--cfg=bar"),
index 24984e91723b2174d8a2aa4ab4ecfc40f4838ee1..1e417a24bbb9510174c9c46a8ebdf695084dda26 100644 (file)
@@ -1616,10 +1616,6 @@ fn two_matching_in_config() {
     assert_that(p1.cargo("run"), execs().with_status(0));
     assert_that(
         p1.cargo("build"),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] [..]
-",
-        ),
+        execs().with_status(0).with_stderr("[FINISHED] [..]"),
     );
 }
index 764d37551c19abd2a6e3adac4e48931f264c4c26..a0904da282e4da74cb25dd43be9404ffe15b9333 100644 (file)
@@ -102,8 +102,7 @@ fn simple() {
             .arg("--index")
             .arg(registry().to_string()),
         execs().with_status(0).with_stdout_contains(
-            "\
-             hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
+            "hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
         ),
     );
 }
@@ -181,8 +180,7 @@ about this warning.
                 reg = registry()
             ))
             .with_stdout_contains(
-                "\
-                 hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
+                "hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
             ),
     );
 }
@@ -262,8 +260,7 @@ about this warning.
                 reg = registry()
             ))
             .with_stdout_contains(
-                "\
-                 hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
+                "hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
             ),
     );
 }
@@ -323,8 +320,7 @@ fn multiple_query_params() {
             .arg("--index")
             .arg(registry().to_string()),
         execs().with_status(0).with_stdout_contains(
-            "\
-             hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
+            "hoare = \"0.1.1\"    # Design by contract style assertions for Rust",
         ),
     );
 }
index aa9606a6571e7336f35e29923c8f3b762c05b022..3711222ec328df7c42b3e8c6c883954eb8685ca0 100644 (file)
@@ -2174,11 +2174,7 @@ fn example_bin_same_name() {
 [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
 [RUNNING] [..]",
             )
-            .with_stdout(
-                "\
-bin
-",
-            ),
+            .with_stdout("bin"),
     );
     assert_that(&p.bin("foo"), existing_file());
 }
@@ -2300,19 +2296,15 @@ fn bad_example() {
 
     assert_that(
         p.cargo("run").arg("--example").arg("foo"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] no example target named `foo`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no example target named `foo`"),
     );
     assert_that(
         p.cargo("run").arg("--bin").arg("foo"),
-        execs().with_status(101).with_stderr(
-            "\
-[ERROR] no bin target named `foo`
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("[ERROR] no bin target named `foo`"),
     );
 }
 
@@ -2765,14 +2757,8 @@ fn test_multiple_packages() {
         p.cargo("test").arg("-p").arg("d1").arg("-p").arg("d2"),
         execs()
             .with_status(0)
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]debug[/]deps[/]d1-[..][EXE]",
-            )
-            .with_stderr_contains(
-                "\
-                 [RUNNING] target[/]debug[/]deps[/]d2-[..][EXE]",
-            )
+            .with_stderr_contains("[RUNNING] target[/]debug[/]deps[/]d1-[..][EXE]")
+            .with_stderr_contains("[RUNNING] target[/]debug[/]deps[/]d2-[..][EXE]")
             .with_stdout_contains_n("running 0 tests", 2),
     );
 }
index deba0a16fa26c6b834bb722b82c8f0cd33d64c90..191c518f3f2750473d9cb806306b9694b3db88f1 100644 (file)
@@ -523,11 +523,9 @@ fn workspace_isnt_root() {
 
     assert_that(
         p.cargo("build"),
-        execs().with_status(101).with_stderr(
-            "\
-error: root of a workspace inferred but wasn't a root: [..]
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: root of a workspace inferred but wasn't a root: [..]"),
     );
 }
 
@@ -747,11 +745,9 @@ fn lock_works_for_everyone() {
 
     assert_that(
         p.cargo("generate-lockfile"),
-        execs().with_status(0).with_stderr(
-            "\
-[UPDATING] registry `[..]`
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[UPDATING] registry `[..]`"),
     );
 
     Package::new("dep1", "0.1.1").publish();
@@ -1370,11 +1366,9 @@ fn you_cannot_generate_lockfile_for_empty_workspaces() {
 
     assert_that(
         p.cargo("update"),
-        execs().with_status(101).with_stderr(
-            "\
-error: you can't generate a lockfile for an empty workspace.
-",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr("error: you can't generate a lockfile for an empty workspace."),
     );
 }
 
@@ -1455,10 +1449,9 @@ fn error_if_parent_cargo_toml_is_invalid() {
 
     assert_that(
         p.cargo("build").cwd(p.root().join("bar")),
-        execs().with_status(101).with_stderr_contains(
-            "\
-             [ERROR] failed to parse manifest at `[..]`",
-        ),
+        execs()
+            .with_status(101)
+            .with_stderr_contains("[ERROR] failed to parse manifest at `[..]`"),
     );
 }
 
@@ -2142,27 +2135,21 @@ fn dep_used_with_separate_features() {
     // features are being built separately.  Should not rebuild anything
     assert_that(
         p.cargo("build").cwd(p.root().join("caller2")),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
     assert_that(
         p.cargo("build").cwd(p.root().join("caller1")),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
     assert_that(
         p.cargo("build").cwd(p.root().join("caller2")),
-        execs().with_status(0).with_stderr(
-            "\
-[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
-",
-        ),
+        execs()
+            .with_status(0)
+            .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
     );
 }