1
- #![ allow( deprecated) ]
2
-
3
1
use cargo_test_support:: project;
4
2
use cargo_test_support:: registry:: Package ;
3
+ use cargo_test_support:: str;
5
4
6
5
mod error;
7
6
mod implicit_features;
@@ -34,20 +33,19 @@ im-a-teapot = "warn"
34
33
35
34
foo. cargo ( "check -Zcargo-lints" )
36
35
. masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
37
- . with_stderr (
38
- "\
39
- warning: unknown lint: `im-a-teapot`
36
+ . with_stderr_data ( str![ [ r#"
37
+ [WARNING] unknown lint: `im-a-teapot`
40
38
--> Cargo.toml:12:1
41
39
|
42
- 12 | im-a-teapot = \ " warn\ "
40
+ 12 | im-a-teapot = "warn"
43
41
| ^^^^^^^^^^^
44
42
|
45
- = note: `cargo::unknown_lints` is set to `warn` by default
46
- = help: there is a lint with a similar name: `im_a_teapot`
47
- [CHECKING] foo v0.0.1 ([CWD] )
48
- [FINISHED] [..]
49
- " ,
50
- )
43
+ = [NOTE] `cargo::unknown_lints` is set to `warn` by default
44
+ = [HELP] there is a lint with a similar name: `im_a_teapot`
45
+ [CHECKING] foo v0.0.1 ([ROOT]/foo )
46
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
47
+
48
+ "# ] ] )
51
49
. run ( ) ;
52
50
}
53
51
@@ -77,17 +75,16 @@ test_dummy_unstable = { level = "forbid", priority = -1 }
77
75
p. cargo ( "check -Zcargo-lints" )
78
76
. masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
79
77
. with_status ( 101 )
80
- . with_stderr (
81
- "\
82
- error: `im_a_teapot` is specified
78
+ . with_stderr_data ( str![ [ r#"
79
+ [ERROR] `im_a_teapot` is specified
83
80
--> Cargo.toml:9:1
84
81
|
85
82
9 | im-a-teapot = true
86
83
| ^^^^^^^^^^^^^^^^^^
87
84
|
88
- = note: `cargo::im_a_teapot` is set to `forbid` in `[lints]`
89
- " ,
90
- )
85
+ = [NOTE] `cargo::im_a_teapot` is set to `forbid` in `[lints]`
86
+
87
+ "# ] ] )
91
88
. run ( ) ;
92
89
}
93
90
@@ -120,17 +117,16 @@ workspace = true
120
117
p. cargo ( "check -Zcargo-lints" )
121
118
. masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
122
119
. with_status ( 101 )
123
- . with_stderr (
124
- "\
125
- error: `im_a_teapot` is specified
120
+ . with_stderr_data ( str![ [ r#"
121
+ [ERROR] `im_a_teapot` is specified
126
122
--> Cargo.toml:13:1
127
123
|
128
124
13 | im-a-teapot = true
129
125
| ^^^^^^^^^^^^^^^^^^
130
126
|
131
- = note: `cargo::im_a_teapot` is set to `forbid` in `[lints]`
132
- " ,
133
- )
127
+ = [NOTE] `cargo::im_a_teapot` is set to `forbid` in `[lints]`
128
+
129
+ "# ] ] )
134
130
. run ( ) ;
135
131
}
136
132
@@ -165,12 +161,11 @@ im-a-teapot = true
165
161
166
162
p. cargo ( "check -Zcargo-lints" )
167
163
. masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
168
- . with_stderr (
169
- "\
170
- [CHECKING] foo v0.0.1 ([CWD]/foo)
171
- [FINISHED] [..]
172
- " ,
173
- )
164
+ . with_stderr_data ( str![ [ r#"
165
+ [CHECKING] foo v0.0.1 ([ROOT]/foo/foo)
166
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
167
+
168
+ "# ] ] )
174
169
. run ( ) ;
175
170
}
176
171
@@ -216,17 +211,16 @@ implicit_features = "warn"
216
211
217
212
p. cargo ( "check -Zcargo-lints" )
218
213
. masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
219
- . with_stderr (
220
- "\
221
- [UPDATING] [..]
214
+ . with_stderr_data ( str![ [ r#"
215
+ [UPDATING] `dummy-registry` index
222
216
[LOCKING] 2 packages to latest compatible versions
223
217
[DOWNLOADING] crates ...
224
- [DOWNLOADED] bar v0.1.0 ([..] )
218
+ [DOWNLOADED] bar v0.1.0 (registry `dummy-registry` )
225
219
[CHECKING] bar v0.1.0
226
- [CHECKING] foo v0.1.0 ([CWD] )
227
- [FINISHED] [..]
228
- " ,
229
- )
220
+ [CHECKING] foo v0.1.0 ([ROOT]/foo )
221
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
222
+
223
+ "# ] ] )
230
224
. run ( ) ;
231
225
}
232
226
@@ -252,18 +246,17 @@ im_a_teapot = "warn"
252
246
p. cargo ( "check -Zcargo-lints" )
253
247
. masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
254
248
. with_status ( 101 )
255
- . with_stderr (
256
- "\
257
- error: use of unstable lint `im_a_teapot`
249
+ . with_stderr_data ( str![ [ r#"
250
+ [ERROR] use of unstable lint `im_a_teapot`
258
251
--> Cargo.toml:9:1
259
252
|
260
- 9 | im_a_teapot = \ " warn\ "
253
+ 9 | im_a_teapot = "warn"
261
254
| ^^^^^^^^^^^ this is behind `test-dummy-unstable`, which is not enabled
262
255
|
263
- = help: consider adding `cargo-features = [\ " test-dummy-unstable\ " ]` to the top of the manifest
264
- error: encountered 1 errors(s) while verifying lints
265
- " ,
266
- )
256
+ = [HELP] consider adding `cargo-features = ["test-dummy-unstable"]` to the top of the manifest
257
+ [ERROR] encountered 1 errors(s) while verifying lints
258
+
259
+ "# ] ] )
267
260
. run ( ) ;
268
261
}
269
262
@@ -300,36 +293,35 @@ workspace = true
300
293
p. cargo ( "check -Zcargo-lints" )
301
294
. masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
302
295
. with_status ( 101 )
303
- . with_stderr (
304
- "\
305
- error: use of unstable lint `im_a_teapot`
296
+ . with_stderr_data ( str![ [ r#"
297
+ [ERROR] use of unstable lint `im_a_teapot`
306
298
--> Cargo.toml:6:1
307
299
|
308
- 6 | im_a_teapot = { level = \ " warn\ " , priority = 10 }
300
+ 6 | im_a_teapot = { level = "warn", priority = 10 }
309
301
| ^^^^^^^^^^^ this is behind `test-dummy-unstable`, which is not enabled
310
302
|
311
- note: `cargo::im_a_teapot` was inherited
303
+ [NOTE] `cargo::im_a_teapot` was inherited
312
304
--> foo/Cargo.toml:9:1
313
305
|
314
306
9 | workspace = true
315
307
| ----------------
316
308
|
317
- = help: consider adding `cargo-features = [\ " test-dummy-unstable\ " ]` to the top of the manifest
318
- error: use of unstable lint `test_dummy_unstable`
309
+ = [HELP] consider adding `cargo-features = ["test-dummy-unstable"]` to the top of the manifest
310
+ [ERROR] use of unstable lint `test_dummy_unstable`
319
311
--> Cargo.toml:7:1
320
312
|
321
- 7 | test_dummy_unstable = { level = \ " forbid\ " , priority = -1 }
313
+ 7 | test_dummy_unstable = { level = "forbid", priority = -1 }
322
314
| ^^^^^^^^^^^^^^^^^^^ this is behind `test-dummy-unstable`, which is not enabled
323
315
|
324
- note: `cargo::test_dummy_unstable` was inherited
316
+ [NOTE] `cargo::test_dummy_unstable` was inherited
325
317
--> foo/Cargo.toml:9:1
326
318
|
327
319
9 | workspace = true
328
320
| ----------------
329
321
|
330
- = help: consider adding `cargo-features = [\ " test-dummy-unstable\ " ]` to the top of the manifest
331
- error: encountered 2 errors(s) while verifying lints
332
- " ,
333
- )
322
+ = [HELP] consider adding `cargo-features = ["test-dummy-unstable"]` to the top of the manifest
323
+ [ERROR] encountered 2 errors(s) while verifying lints
324
+
325
+ "# ] ] )
334
326
. run ( ) ;
335
327
}
0 commit comments