@@ -323,3 +323,128 @@ workspace = true
323323"# ] ] )
324324 . run ( ) ;
325325}
326+
327+ #[ cargo_test( nightly, reason = "-Zrustc-unicode is unstable" ) ]
328+ fn unicode_report ( ) {
329+ let p = project ( )
330+ . file (
331+ "Cargo.toml" ,
332+ r#"
333+ cargo-features = ["test-dummy-unstable"]
334+
335+ [package]
336+ name = "foo"
337+ version = "0.0.1"
338+ edition = "2015"
339+ authors = []
340+ im-a-teapot = true
341+
342+ [lints.cargo]
343+ im_a_teapot = { level = "warn", priority = 10 }
344+ "# ,
345+ )
346+ . file ( "src/lib.rs" , "" )
347+ . build ( ) ;
348+
349+ p. cargo ( "check -Zcargo-lints -Zrustc-unicode" )
350+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "rustc-unicode" , "test-dummy-unstable" ] )
351+ . with_stderr_data ( str![ [ r#"
352+ [WARNING] `im_a_teapot` is specified
353+ ╭▸ Cargo.toml:9:1
354+ │
355+ 9 │ im-a-teapot = true
356+ │ ━━━━━━━━━━━━━━━━━━
357+ │
358+ ╰ [NOTE] `cargo::im_a_teapot` is set to `warn` in `[lints]`
359+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
360+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
361+
362+ "# ] ] )
363+ . run ( ) ;
364+ }
365+
366+ #[ cargo_test( nightly, reason = "-Zrustc-unicode is unstable" ) ]
367+ fn unicode_report_config ( ) {
368+ let p = project ( )
369+ . file (
370+ "Cargo.toml" ,
371+ r#"
372+ cargo-features = ["test-dummy-unstable"]
373+
374+ [package]
375+ name = "foo"
376+ version = "0.0.1"
377+ edition = "2015"
378+ authors = []
379+ im-a-teapot = true
380+
381+ [lints.cargo]
382+ im_a_teapot = { level = "warn", priority = 10 }
383+ "# ,
384+ )
385+ . file ( "src/lib.rs" , "" )
386+ . file (
387+ ".cargo/config.toml" ,
388+ r#"
389+ [unstable]
390+ rustc-unicode = true
391+ "# ,
392+ )
393+ . build ( ) ;
394+
395+ p. cargo ( "check -Zcargo-lints" )
396+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "rustc-unicode" , "test-dummy-unstable" ] )
397+ . with_stderr_data ( str![ [ r#"
398+ [WARNING] `im_a_teapot` is specified
399+ ╭▸ Cargo.toml:9:1
400+ │
401+ 9 │ im-a-teapot = true
402+ │ ━━━━━━━━━━━━━━━━━━
403+ │
404+ ╰ [NOTE] `cargo::im_a_teapot` is set to `warn` in `[lints]`
405+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
406+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
407+
408+ "# ] ] )
409+ . run ( ) ;
410+ }
411+
412+ #[ cargo_test( nightly, reason = "-Zrustc-unicode is unstable" ) ]
413+ fn unicode_report_env_var ( ) {
414+ let p = project ( )
415+ . file (
416+ "Cargo.toml" ,
417+ r#"
418+ cargo-features = ["test-dummy-unstable"]
419+
420+ [package]
421+ name = "foo"
422+ version = "0.0.1"
423+ edition = "2015"
424+ authors = []
425+ im-a-teapot = true
426+
427+ [lints.cargo]
428+ im_a_teapot = { level = "warn", priority = 10 }
429+ "# ,
430+ )
431+ . file ( "src/lib.rs" , "" )
432+ . build ( ) ;
433+
434+ p. cargo ( "check -Zcargo-lints" )
435+ . env ( "CARGO_UNSTABLE_RUSTC_UNICODE" , "true" )
436+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "rustc-unicode" , "test-dummy-unstable" ] )
437+ . with_stderr_data ( str![ [ r#"
438+ [WARNING] `im_a_teapot` is specified
439+ ╭▸ Cargo.toml:9:1
440+ │
441+ 9 │ im-a-teapot = true
442+ │ ━━━━━━━━━━━━━━━━━━
443+ │
444+ ╰ [NOTE] `cargo::im_a_teapot` is set to `warn` in `[lints]`
445+ [CHECKING] foo v0.0.1 ([ROOT]/foo)
446+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
447+
448+ "# ] ] )
449+ . run ( ) ;
450+ }
0 commit comments