1- #![ allow( deprecated) ]
2-
31use cargo_test_support:: project;
42use cargo_test_support:: registry:: Package ;
3+ use cargo_test_support:: str;
54
65mod error;
76mod implicit_features;
@@ -34,20 +33,19 @@ im-a-teapot = "warn"
3433
3534 foo. cargo ( "check -Zcargo-lints" )
3635 . 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`
4038 --> Cargo.toml:12:1
4139 |
42- 12 | im-a-teapot = \ " warn\ "
40+ 12 | im-a-teapot = "warn"
4341 | ^^^^^^^^^^^
4442 |
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+ "# ] ] )
5149 . run ( ) ;
5250}
5351
@@ -77,17 +75,16 @@ test_dummy_unstable = { level = "forbid", priority = -1 }
7775 p. cargo ( "check -Zcargo-lints" )
7876 . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
7977 . 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
8380 --> Cargo.toml:9:1
8481 |
85829 | im-a-teapot = true
8683 | ^^^^^^^^^^^^^^^^^^
8784 |
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+ "# ] ] )
9188 . run ( ) ;
9289}
9390
@@ -120,17 +117,16 @@ workspace = true
120117 p. cargo ( "check -Zcargo-lints" )
121118 . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
122119 . 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
126122 --> Cargo.toml:13:1
127123 |
12812413 | im-a-teapot = true
129125 | ^^^^^^^^^^^^^^^^^^
130126 |
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+ "# ] ] )
134130 . run ( ) ;
135131}
136132
@@ -165,12 +161,11 @@ im-a-teapot = true
165161
166162 p. cargo ( "check -Zcargo-lints" )
167163 . 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+ "# ] ] )
174169 . run ( ) ;
175170}
176171
@@ -216,17 +211,16 @@ implicit_features = "warn"
216211
217212 p. cargo ( "check -Zcargo-lints" )
218213 . masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
219- . with_stderr (
220- "\
221- [UPDATING] [..]
214+ . with_stderr_data ( str![ [ r#"
215+ [UPDATING] `dummy-registry` index
222216[LOCKING] 2 packages to latest compatible versions
223217[DOWNLOADING] crates ...
224- [DOWNLOADED] bar v0.1.0 ([..] )
218+ [DOWNLOADED] bar v0.1.0 (registry `dummy-registry` )
225219[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+ "# ] ] )
230224 . run ( ) ;
231225}
232226
@@ -252,18 +246,17 @@ im_a_teapot = "warn"
252246 p. cargo ( "check -Zcargo-lints" )
253247 . masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
254248 . 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`
258251 --> Cargo.toml:9:1
259252 |
260- 9 | im_a_teapot = \ " warn\ "
253+ 9 | im_a_teapot = "warn"
261254 | ^^^^^^^^^^^ this is behind `test-dummy-unstable`, which is not enabled
262255 |
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+ "# ] ] )
267260 . run ( ) ;
268261}
269262
@@ -300,36 +293,35 @@ workspace = true
300293 p. cargo ( "check -Zcargo-lints" )
301294 . masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
302295 . 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`
306298 --> Cargo.toml:6:1
307299 |
308- 6 | im_a_teapot = { level = \ " warn\ " , priority = 10 }
300+ 6 | im_a_teapot = { level = "warn", priority = 10 }
309301 | ^^^^^^^^^^^ this is behind `test-dummy-unstable`, which is not enabled
310302 |
311- note: `cargo::im_a_teapot` was inherited
303+ [NOTE] `cargo::im_a_teapot` was inherited
312304 --> foo/Cargo.toml:9:1
313305 |
3143069 | workspace = true
315307 | ----------------
316308 |
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`
319311 --> Cargo.toml:7:1
320312 |
321- 7 | test_dummy_unstable = { level = \ " forbid\ " , priority = -1 }
313+ 7 | test_dummy_unstable = { level = "forbid", priority = -1 }
322314 | ^^^^^^^^^^^^^^^^^^^ this is behind `test-dummy-unstable`, which is not enabled
323315 |
324- note: `cargo::test_dummy_unstable` was inherited
316+ [NOTE] `cargo::test_dummy_unstable` was inherited
325317 --> foo/Cargo.toml:9:1
326318 |
3273199 | workspace = true
328320 | ----------------
329321 |
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+ "# ] ] )
334326 . run ( ) ;
335327}
0 commit comments