Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cleanup: remove unnecessary with_status(0) #6630

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4628,13 +4628,11 @@ Did you mean `ex1`?",
.run();

ws.cargo("build -v --lib")
.with_status(0)
.with_stderr_contains("[RUNNING] `rustc [..]a/src/lib.rs[..]")
.with_stderr_contains("[RUNNING] `rustc [..]b/src/lib.rs[..]")
.run();

ws.cargo("build -v --example ex1")
.with_status(0)
.with_stderr_contains("[RUNNING] `rustc [..]a/examples/ex1.rs[..]")
.run();
}
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ fn workspace_different_locations() {
p.cargo("build").cwd(p.root().join("foo")).run();
p.cargo("build")
.cwd(p.root().join("bar"))
.with_status(0)
.with_stderr(
"\
[COMPILING] bar [..]
Expand Down
5 changes: 1 addition & 4 deletions tests/testsuite/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@ fn edition_works_for_build_script() {
.file("a/src/lib.rs", "pub fn foo() {}")
.build();

p.cargo("build -v")
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
p.cargo("build -v").masquerade_as_nightly_cargo().run();
}
2 changes: 0 additions & 2 deletions tests/testsuite/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,6 @@ fn fix_idioms() {
";
p.cargo("fix --edition-idioms --allow-no-vcs")
.with_stderr(stderr)
.with_status(0)
.run();

assert!(p.read_file("src/lib.rs").contains("Box<dyn Any>"));
Expand All @@ -955,7 +954,6 @@ fn idioms_2015_ok() {

p.cargo("fix --edition-idioms --allow-no-vcs")
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
}

Expand Down
10 changes: 2 additions & 8 deletions tests/testsuite/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,10 +1263,7 @@ fn package_with_select_features() {
)
.build();

p.cargo("package --features required")
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
p.cargo("package --features required").masquerade_as_nightly_cargo().run();
}

#[test]
Expand Down Expand Up @@ -1295,10 +1292,7 @@ fn package_with_all_features() {
)
.build();

p.cargo("package --all-features")
.masquerade_as_nightly_cargo()
.with_status(0)
.run();
p.cargo("package --all-features").masquerade_as_nightly_cargo().run();
}

#[test]
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ required by package `foo v0.0.1 ([..])`
.run();

p.cargo("update -p baz")
.with_status(0)
.with_stderr_contains(
"\
[UPDATING] `[..]` index
Expand Down
11 changes: 2 additions & 9 deletions tests/testsuite/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,7 @@ fn run_workspace() {
available binaries: a, b",
)
.run();
p.cargo("run --bin a")
.with_status(0)
.with_stdout("run-a")
.run();
p.cargo("run --bin a").with_stdout("run-a").run();
}

#[test]
Expand Down Expand Up @@ -1130,11 +1127,7 @@ fn default_run_workspace() {
.file("b/src/main.rs", r#"fn main() {println!("run-b");}"#)
.build();

p.cargo("run")
.masquerade_as_nightly_cargo()
.with_status(0)
.with_stdout("run-a")
.run();
p.cargo("run").masquerade_as_nightly_cargo().with_stdout("run-a").run();
}

#[test]
Expand Down
2 changes: 0 additions & 2 deletions tests/testsuite/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,6 @@ fn ws_warn_unused() {
.file("a/src/lib.rs", "")
.build();
p.cargo("check")
.with_status(0)
.with_stderr_contains(&format!(
"\
[WARNING] {} for the non root package will be ignored, specify {} at the workspace root:
Expand Down Expand Up @@ -2111,7 +2110,6 @@ fn ws_warn_path() {
.build();

p.cargo("check")
.with_status(0)
.with_stderr_contains("[WARNING] [..]/foo/a/Cargo.toml: the cargo feature `edition`[..]")
.run();
}