Skip to content

Commit

Permalink
Prettify rustfmted single-line strings
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad authored and alexcrichton committed Mar 15, 2018
1 parent 1e68284 commit b0c181d
Show file tree
Hide file tree
Showing 33 changed files with 293 additions and 650 deletions.
38 changes: 8 additions & 30 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
)
}
Expand Down
32 changes: 11 additions & 21 deletions tests/testsuite/bad_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [..]"),
);
}

Expand Down Expand Up @@ -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",
),
);
}
Expand Down Expand Up @@ -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 [..]"),
);
}

Expand Down Expand Up @@ -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 [..]",
),
);
}
Expand Down Expand Up @@ -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`"),
);
}

Expand Down
12 changes: 4 additions & 8 deletions tests/testsuite/bad_manifest_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}\
",
),
);
Expand All @@ -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\"}\
",
),
);
Expand All @@ -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\"}\
",
),
);
Expand All @@ -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\"}\
",
),
);
Expand Down
50 changes: 10 additions & 40 deletions tests/testsuite/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 [..]"),
);
Expand Down Expand Up @@ -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: [..]"),
);
}
Expand Down Expand Up @@ -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: [..]"),
);
}
Expand Down Expand Up @@ -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: [..]"),
);
}
Expand Down Expand Up @@ -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: [..]"),
);
}
77 changes: 29 additions & 48 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
);
}

Expand Down Expand Up @@ -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`[..]"),
);
}

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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`[..]"),
);
}

Expand Down Expand Up @@ -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(
Expand All @@ -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"),
);
}

Expand Down Expand Up @@ -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[..]",
),
);
}
Expand Down Expand Up @@ -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(
"\
Expand Down Expand Up @@ -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"),
);
}
Loading

0 comments on commit b0c181d

Please sign in to comment.