File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,70 @@ See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#lints for mo
6969 . run ( ) ;
7070}
7171
72+ #[ cargo_test]
73+ fn malformed_on_stable ( ) {
74+ let foo = project ( )
75+ . file (
76+ "Cargo.toml" ,
77+ r#"
78+ lints = 20
79+ [package]
80+ name = "foo"
81+ version = "0.0.1"
82+ authors = []
83+
84+ "# ,
85+ )
86+ . file ( "src/lib.rs" , "" )
87+ . build ( ) ;
88+
89+ foo. cargo ( "check" )
90+ . with_status ( 101 )
91+ . with_stderr (
92+ "\
93+ error: failed to parse manifest[..]
94+
95+ Caused by:
96+ invalid type: integer `20`, expected a map
97+ in `lints`
98+ " ,
99+ )
100+ . run ( ) ;
101+ }
102+
103+ #[ cargo_test]
104+ fn malformed_on_nightly ( ) {
105+ let foo = project ( )
106+ . file (
107+ "Cargo.toml" ,
108+ r#"
109+ cargo-features = ["lints"]
110+ lints = 20
111+ [package]
112+ name = "foo"
113+ version = "0.0.1"
114+ authors = []
115+
116+ "# ,
117+ )
118+ . file ( "src/lib.rs" , "" )
119+ . build ( ) ;
120+
121+ foo. cargo ( "check" )
122+ . masquerade_as_nightly_cargo ( & [ "lints" ] )
123+ . with_status ( 101 )
124+ . with_stderr (
125+ "\
126+ error: failed to parse manifest[..]
127+
128+ Caused by:
129+ invalid type: integer `20`, expected a map
130+ in `lints`
131+ " ,
132+ )
133+ . run ( ) ;
134+ }
135+
72136#[ cargo_test]
73137fn fail_on_invalid_tool ( ) {
74138 let foo = project ( )
You can’t perform that action at this time.
0 commit comments