File tree Expand file tree Collapse file tree 2 files changed +37
-30
lines changed Expand file tree Collapse file tree 2 files changed +37
-30
lines changed Original file line number Diff line number Diff line change @@ -162,36 +162,6 @@ invalid value: integer `-1`, expected u32
162162 . run ( ) ;
163163}
164164
165- #[ cargo_test]
166- fn default_cargo_config_jobs ( ) {
167- let p = project ( )
168- . file ( "src/lib.rs" , "" )
169- . file (
170- ".cargo/config" ,
171- r#"
172- [build]
173- jobs = 1
174- "# ,
175- )
176- . build ( ) ;
177- p. cargo ( "build -v" ) . run ( ) ;
178- }
179-
180- #[ cargo_test]
181- fn good_cargo_config_jobs ( ) {
182- let p = project ( )
183- . file ( "src/lib.rs" , "" )
184- . file (
185- ".cargo/config" ,
186- r#"
187- [build]
188- jobs = 4
189- "# ,
190- )
191- . build ( ) ;
192- p. cargo ( "build -v" ) . run ( ) ;
193- }
194-
195165#[ cargo_test]
196166fn invalid_global_config ( ) {
197167 let p = project ( )
Original file line number Diff line number Diff line change @@ -4297,13 +4297,50 @@ required by package `bar v0.1.0 ([..]/foo)`
42974297 . run ( ) ;
42984298}
42994299
4300+ #[ cargo_test]
4301+ fn default_cargo_config_jobs ( ) {
4302+ let p = project ( )
4303+ . file ( "src/lib.rs" , "" )
4304+ . file (
4305+ ".cargo/config" ,
4306+ r#"
4307+ [build]
4308+ jobs = 1
4309+ "# ,
4310+ )
4311+ . build ( ) ;
4312+ p. cargo ( "build -v" ) . run ( ) ;
4313+ }
4314+
4315+ #[ cargo_test]
4316+ fn good_cargo_config_jobs ( ) {
4317+ let p = project ( )
4318+ . file ( "src/lib.rs" , "" )
4319+ . file (
4320+ ".cargo/config" ,
4321+ r#"
4322+ [build]
4323+ jobs = 4
4324+ "# ,
4325+ )
4326+ . build ( ) ;
4327+ p. cargo ( "build -v" ) . run ( ) ;
4328+ }
4329+
43004330#[ cargo_test]
43014331fn invalid_jobs ( ) {
43024332 let p = project ( )
43034333 . file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
43044334 . file ( "src/foo.rs" , & main_file ( r#""i am foo""# , & [ ] ) )
43054335 . build ( ) ;
43064336
4337+ p. cargo ( "build --jobs -1" )
4338+ . with_status ( 1 )
4339+ . with_stderr_contains (
4340+ "error: Found argument '-1' which wasn't expected, or isn't valid in this context" ,
4341+ )
4342+ . run ( ) ;
4343+
43074344 p. cargo ( "build --jobs over9000" )
43084345 . with_status ( 1 )
43094346 . with_stderr ( "error: Invalid value: could not parse `over9000` as a number" )
You can’t perform that action at this time.
0 commit comments