Skip to content

Commit f75b4d7

Browse files
committed
test: migrate lints/unknown_lints to snapbox
1 parent 676e97a commit f75b4d7

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

tests/testsuite/lints/unknown_lints.rs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#![allow(deprecated)]
2-
31
use cargo_test_support::project;
2+
use cargo_test_support::str;
43

54
#[cargo_test]
65
fn default() {
@@ -23,19 +22,18 @@ this-lint-does-not-exist = "warn"
2322

2423
p.cargo("check -Zcargo-lints")
2524
.masquerade_as_nightly_cargo(&["cargo-lints"])
26-
.with_stderr(
27-
"\
28-
warning: unknown lint: `this-lint-does-not-exist`
25+
.with_stderr_data(str![[r#"
26+
[WARNING] unknown lint: `this-lint-does-not-exist`
2927
--> Cargo.toml:9:1
3028
|
31-
9 | this-lint-does-not-exist = \"warn\"
29+
9 | this-lint-does-not-exist = "warn"
3230
| ^^^^^^^^^^^^^^^^^^^^^^^^
3331
|
34-
= note: `cargo::unknown_lints` is set to `warn` by default
35-
[CHECKING] foo v0.0.1 ([CWD])
36-
[FINISHED] [..]
37-
",
38-
)
32+
= [NOTE] `cargo::unknown_lints` is set to `warn` by default
33+
[CHECKING] foo v0.0.1 ([ROOT]/foo)
34+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
35+
36+
"#]])
3937
.run();
4038
}
4139

@@ -70,24 +68,23 @@ workspace = true
7068

7169
p.cargo("check -Zcargo-lints")
7270
.masquerade_as_nightly_cargo(&["cargo-lints"])
73-
.with_stderr(
74-
"\
75-
warning: unknown lint: `this-lint-does-not-exist`
71+
.with_stderr_data(str![[r#"
72+
[WARNING] unknown lint: `this-lint-does-not-exist`
7673
--> Cargo.toml:6:1
7774
|
78-
6 | this-lint-does-not-exist = \"warn\"
75+
6 | this-lint-does-not-exist = "warn"
7976
| ^^^^^^^^^^^^^^^^^^^^^^^^
8077
|
81-
note: `cargo::this-lint-does-not-exist` was inherited
78+
[NOTE] `cargo::this-lint-does-not-exist` was inherited
8279
--> foo/Cargo.toml:9:1
8380
|
8481
9 | workspace = true
8582
| ----------------
8683
|
87-
= note: `cargo::unknown_lints` is set to `warn` by default
88-
[CHECKING] foo v0.0.1 ([CWD]/foo)
89-
[FINISHED] [..]
90-
",
91-
)
84+
= [NOTE] `cargo::unknown_lints` is set to `warn` by default
85+
[CHECKING] foo v0.0.1 ([ROOT]/foo/foo)
86+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
87+
88+
"#]])
9289
.run();
9390
}

0 commit comments

Comments
 (0)