File tree 7 files changed +262
-0
lines changed
7 files changed +262
-0
lines changed Original file line number Diff line number Diff line change
1
+ use cargo_test_support:: prelude:: * ;
2
+ use cargo_test_support:: str;
3
+ use cargo_test_support:: { file, project} ;
4
+
5
+ #[ cargo_test]
6
+ fn case ( ) {
7
+ let p = project ( )
8
+ . file (
9
+ "Cargo.toml" ,
10
+ r#"
11
+ cargo-features = ["test-dummy-unstable"]
12
+
13
+ [package]
14
+ name = "foo"
15
+ version = "0.0.1"
16
+ edition = "2015"
17
+ authors = []
18
+ im-a-teapot = true
19
+
20
+ [lints.cargo]
21
+ im_a_teapot = "deny"
22
+ "# ,
23
+ )
24
+ . file ( "src/lib.rs" , "" )
25
+ . build ( ) ;
26
+
27
+ snapbox:: cmd:: Command :: cargo_ui ( )
28
+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
29
+ . current_dir ( p. root ( ) )
30
+ . arg ( "check" )
31
+ . arg ( "-Zcargo-lints" )
32
+ . assert ( )
33
+ . code ( 101 )
34
+ . stdout_matches ( str![ "" ] )
35
+ . stderr_matches ( file ! [ "stderr.term.svg" ] ) ;
36
+ }
Original file line number Diff line number Diff line change
1
+ use cargo_test_support:: prelude:: * ;
2
+ use cargo_test_support:: str;
3
+ use cargo_test_support:: { file, project} ;
4
+
5
+ #[ cargo_test]
6
+ fn case ( ) {
7
+ let p = project ( )
8
+ . file (
9
+ "Cargo.toml" ,
10
+ r#"
11
+ [workspace]
12
+ members = ["foo"]
13
+
14
+ [workspace.lints.cargo]
15
+ im_a_teapot = { level = "warn", priority = 10 }
16
+ "# ,
17
+ )
18
+ . file (
19
+ "foo/Cargo.toml" ,
20
+ r#"
21
+ [package]
22
+ name = "foo"
23
+ version = "0.0.1"
24
+ edition = "2015"
25
+ authors = []
26
+
27
+ [lints]
28
+ workspace = true
29
+ "# ,
30
+ )
31
+ . file ( "foo/src/lib.rs" , "" )
32
+ . build ( ) ;
33
+
34
+ snapbox:: cmd:: Command :: cargo_ui ( )
35
+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" ] )
36
+ . current_dir ( p. root ( ) )
37
+ . arg ( "check" )
38
+ . arg ( "-Zcargo-lints" )
39
+ . assert ( )
40
+ . code ( 101 )
41
+ . stdout_matches ( str![ "" ] )
42
+ . stderr_matches ( file ! [ "stderr.term.svg" ] ) ;
43
+ }
Original file line number Diff line number Diff line change 1
1
use cargo_test_support:: project;
2
2
use cargo_test_support:: registry:: Package ;
3
3
4
+ mod error;
4
5
mod implicit_features;
6
+ mod inherited;
5
7
mod unknown_lints;
6
8
mod unused_optional_dependencies;
9
+ mod warning;
7
10
8
11
#[ cargo_test]
9
12
fn dashes_dont_get_rewritten ( ) {
Original file line number Diff line number Diff line change
1
+ use cargo_test_support:: prelude:: * ;
2
+ use cargo_test_support:: str;
3
+ use cargo_test_support:: { file, project} ;
4
+
5
+ #[ cargo_test]
6
+ fn case ( ) {
7
+ let p = project ( )
8
+ . file (
9
+ "Cargo.toml" ,
10
+ r#"
11
+ cargo-features = ["test-dummy-unstable"]
12
+
13
+ [package]
14
+ name = "foo"
15
+ version = "0.0.1"
16
+ edition = "2015"
17
+ authors = []
18
+ im-a-teapot = true
19
+
20
+ [lints.cargo]
21
+ im_a_teapot = "warn"
22
+ "# ,
23
+ )
24
+ . file ( "src/lib.rs" , "" )
25
+ . build ( ) ;
26
+
27
+ snapbox:: cmd:: Command :: cargo_ui ( )
28
+ . masquerade_as_nightly_cargo ( & [ "cargo-lints" , "test-dummy-unstable" ] )
29
+ . current_dir ( p. root ( ) )
30
+ . arg ( "check" )
31
+ . arg ( "-Zcargo-lints" )
32
+ . assert ( )
33
+ . success ( )
34
+ . stdout_matches ( str![ "" ] )
35
+ . stderr_matches ( file ! [ "stderr.term.svg" ] ) ;
36
+ }
You can’t perform that action at this time.
0 commit comments