Skip to content

Commit 20b3734

Browse files
committed
refactor: Improve lint tests
1 parent 6f06fe9 commit 20b3734

File tree

7 files changed

+62
-13
lines changed

7 files changed

+62
-13
lines changed

tests/testsuite/lints/implicit_features/edition_2021/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use cargo_test_support::prelude::*;
22
use cargo_test_support::project;
33
use cargo_test_support::registry::Package;
4-
use cargo_test_support::str;
4+
use cargo_test_support::{file, str};
55

66
#[cargo_test]
77
fn case() {
@@ -23,12 +23,10 @@ bar = { version = "0.1.0", optional = true }
2323
.build();
2424

2525
snapbox::cmd::Command::cargo_ui()
26-
.masquerade_as_nightly_cargo(&["always_nightly"])
2726
.current_dir(p.root())
2827
.arg("check")
29-
.arg("--quiet")
3028
.assert()
3129
.success()
3230
.stdout_matches(str![""])
33-
.stderr_matches(str![""]);
31+
.stderr_matches(file!["stderr.term.svg"]);
3432
}
Lines changed: 33 additions & 0 deletions
Loading

tests/testsuite/lints/implicit_features/edition_2021_warn/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ implicit-features = "warn"
2626
.build();
2727

2828
snapbox::cmd::Command::cargo_ui()
29-
.masquerade_as_nightly_cargo(&["always_nightly"])
29+
.masquerade_as_nightly_cargo(&["cargo-lints"])
3030
.current_dir(p.root())
3131
.arg("check")
32-
.arg("--quiet")
32+
.arg("-Zcargo-lints")
3333
.assert()
3434
.success()
3535
.stdout_matches(str![""])

tests/testsuite/lints/implicit_features/edition_2021_warn/stderr.term.svg

Lines changed: 11 additions & 2 deletions
Loading

tests/testsuite/lints/implicit_features/edition_2024/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ baz = ["dep:baz"]
2929
.build();
3030

3131
snapbox::cmd::Command::cargo_ui()
32-
.masquerade_as_nightly_cargo(&["always_nightly"])
32+
.masquerade_as_nightly_cargo(&["edition2024"])
3333
.current_dir(p.root())
3434
.arg("check")
3535
.assert()

tests/testsuite/lints/implicit_features/warn/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ implicit-features = "warn"
2727
.build();
2828

2929
snapbox::cmd::Command::cargo_ui()
30-
.masquerade_as_nightly_cargo(&["always_nightly"])
30+
.masquerade_as_nightly_cargo(&["cargo-lints", "edition2024"])
3131
.current_dir(p.root())
3232
.arg("check")
33-
.arg("--quiet")
33+
.arg("-Zcargo-lints")
3434
.assert()
3535
.success()
3636
.stdout_matches(str![""])

tests/testsuite/lints/implicit_features/warn/stderr.term.svg

Lines changed: 11 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)