|
1 | | -#![allow(deprecated)] |
2 | | - |
3 | 1 | use cargo_test_support::project; |
4 | 2 | use cargo_test_support::registry::Package; |
5 | 3 | use cargo_test_support::str; |
@@ -34,34 +32,33 @@ target-dep = { version = "0.1.0", optional = true } |
34 | 32 |
|
35 | 33 | p.cargo("check -Zcargo-lints") |
36 | 34 | .masquerade_as_nightly_cargo(&["cargo-lints", "edition2024"]) |
37 | | - .with_stderr( |
38 | | - "\ |
39 | | -warning: unused optional dependency |
| 35 | + .with_stderr_data(str![[r#" |
| 36 | +[WARNING] unused optional dependency |
40 | 37 | --> Cargo.toml:9:1 |
41 | 38 | | |
42 | | -9 | bar = { version = \"0.1.0\", optional = true } |
| 39 | +9 | bar = { version = "0.1.0", optional = true } |
43 | 40 | | --- |
44 | 41 | | |
45 | | - = note: `cargo::unused_optional_dependency` is set to `warn` by default |
46 | | - = help: remove the dependency or activate it in a feature with `dep:bar` |
47 | | -warning: unused optional dependency |
| 42 | + = [NOTE] `cargo::unused_optional_dependency` is set to `warn` by default |
| 43 | + = [HELP] remove the dependency or activate it in a feature with `dep:bar` |
| 44 | +[WARNING] unused optional dependency |
48 | 45 | --> Cargo.toml:12:1 |
49 | 46 | | |
50 | | -12 | baz = { version = \"0.1.0\", optional = true } |
| 47 | +12 | baz = { version = "0.1.0", optional = true } |
51 | 48 | | --- |
52 | 49 | | |
53 | | - = help: remove the dependency or activate it in a feature with `dep:baz` |
54 | | -warning: unused optional dependency |
| 50 | + = [HELP] remove the dependency or activate it in a feature with `dep:baz` |
| 51 | +[WARNING] unused optional dependency |
55 | 52 | --> Cargo.toml:15:1 |
56 | 53 | | |
57 | | -15 | target-dep = { version = \"0.1.0\", optional = true } |
| 54 | +15 | target-dep = { version = "0.1.0", optional = true } |
58 | 55 | | ---------- |
59 | 56 | | |
60 | | - = help: remove the dependency or activate it in a feature with `dep:target-dep` |
61 | | -[CHECKING] foo v0.1.0 ([CWD]) |
62 | | -[FINISHED] [..] |
63 | | -", |
64 | | - ) |
| 57 | + = [HELP] remove the dependency or activate it in a feature with `dep:target-dep` |
| 58 | +[CHECKING] foo v0.1.0 ([ROOT]/foo) |
| 59 | +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
| 60 | +
|
| 61 | +"#]]) |
65 | 62 | .run(); |
66 | 63 | } |
67 | 64 |
|
@@ -89,14 +86,13 @@ implicit_features = "allow" |
89 | 86 |
|
90 | 87 | p.cargo("check -Zcargo-lints") |
91 | 88 | .masquerade_as_nightly_cargo(&["cargo-lints"]) |
92 | | - .with_stderr( |
93 | | - "\ |
94 | | -[UPDATING] [..] |
| 89 | + .with_stderr_data(str![[r#" |
| 90 | +[UPDATING] `dummy-registry` index |
95 | 91 | [LOCKING] 2 packages to latest compatible versions |
96 | | -[CHECKING] foo v0.1.0 ([CWD]) |
97 | | -[FINISHED] [..] |
98 | | -", |
99 | | - ) |
| 92 | +[CHECKING] foo v0.1.0 ([ROOT]/foo) |
| 93 | +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
| 94 | +
|
| 95 | +"#]]) |
100 | 96 | .run(); |
101 | 97 | } |
102 | 98 |
|
@@ -130,34 +126,33 @@ target-dep = { version = "0.1.0", optional = true } |
130 | 126 |
|
131 | 127 | p.cargo("check -Zcargo-lints") |
132 | 128 | .masquerade_as_nightly_cargo(&["cargo-lints", "edition2024"]) |
133 | | - .with_stderr( |
134 | | - "\ |
135 | | -warning: unused optional dependency |
| 129 | + .with_stderr_data(str![[r#" |
| 130 | +[WARNING] unused optional dependency |
136 | 131 | --> Cargo.toml:9:1 |
137 | 132 | | |
138 | | -9 | bar = { version = \"0.1.0\", optional = true } |
| 133 | +9 | bar = { version = "0.1.0", optional = true } |
139 | 134 | | --- |
140 | 135 | | |
141 | | - = note: `cargo::unused_optional_dependency` is set to `warn` by default |
142 | | - = help: remove the dependency or activate it in a feature with `dep:bar` |
143 | | -warning: unused optional dependency |
| 136 | + = [NOTE] `cargo::unused_optional_dependency` is set to `warn` by default |
| 137 | + = [HELP] remove the dependency or activate it in a feature with `dep:bar` |
| 138 | +[WARNING] unused optional dependency |
144 | 139 | --> Cargo.toml:12:1 |
145 | 140 | | |
146 | | -12 | baz = { version = \"0.2.0\", package = \"bar\", optional = true } |
| 141 | +12 | baz = { version = "0.2.0", package = "bar", optional = true } |
147 | 142 | | --- |
148 | 143 | | |
149 | | - = help: remove the dependency or activate it in a feature with `dep:baz` |
150 | | -warning: unused optional dependency |
| 144 | + = [HELP] remove the dependency or activate it in a feature with `dep:baz` |
| 145 | +[WARNING] unused optional dependency |
151 | 146 | --> Cargo.toml:15:1 |
152 | 147 | | |
153 | | -15 | target-dep = { version = \"0.1.0\", optional = true } |
| 148 | +15 | target-dep = { version = "0.1.0", optional = true } |
154 | 149 | | ---------- |
155 | 150 | | |
156 | | - = help: remove the dependency or activate it in a feature with `dep:target-dep` |
157 | | -[CHECKING] foo v0.1.0 ([CWD]) |
158 | | -[FINISHED] [..] |
159 | | -", |
160 | | - ) |
| 151 | + = [HELP] remove the dependency or activate it in a feature with `dep:target-dep` |
| 152 | +[CHECKING] foo v0.1.0 ([ROOT]/foo) |
| 153 | +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
| 154 | +
|
| 155 | +"#]]) |
161 | 156 | .run(); |
162 | 157 | } |
163 | 158 |
|
@@ -186,20 +181,19 @@ optional-dep = [] |
186 | 181 |
|
187 | 182 | p.cargo("check -Zcargo-lints") |
188 | 183 | .masquerade_as_nightly_cargo(&["cargo-lints", "edition2024"]) |
189 | | - .with_stderr( |
190 | | - "\ |
191 | | -warning: unused optional dependency |
| 184 | + .with_stderr_data(str![[r#" |
| 185 | +[WARNING] unused optional dependency |
192 | 186 | --> Cargo.toml:9:1 |
193 | 187 | | |
194 | | -9 | optional-dep = { version = \"0.1.0\", optional = true } |
| 188 | +9 | optional-dep = { version = "0.1.0", optional = true } |
195 | 189 | | ------------ |
196 | 190 | | |
197 | | - = note: `cargo::unused_optional_dependency` is set to `warn` by default |
198 | | - = help: remove the dependency or activate it in a feature with `dep:optional-dep` |
199 | | -[CHECKING] foo v0.1.0 ([CWD]) |
200 | | -[FINISHED] [..] |
201 | | -", |
202 | | - ) |
| 191 | + = [NOTE] `cargo::unused_optional_dependency` is set to `warn` by default |
| 192 | + = [HELP] remove the dependency or activate it in a feature with `dep:optional-dep` |
| 193 | +[CHECKING] foo v0.1.0 ([ROOT]/foo) |
| 194 | +[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s |
| 195 | +
|
| 196 | +"#]]) |
203 | 197 | .run(); |
204 | 198 | } |
205 | 199 |
|
|
0 commit comments