@@ -7,7 +7,7 @@ use snapbox::str;
7
7
use cargo_test_support:: compare:: assert_e2e;
8
8
use cargo_test_support:: registry:: { Package , RegistryBuilder } ;
9
9
use cargo_test_support:: {
10
- basic_bin_manifest, cargo_test, project, symlink_supported, ProjectBuilder ,
10
+ basic_bin_manifest, cargo_process , cargo_test, project, symlink_supported, ProjectBuilder ,
11
11
} ;
12
12
13
13
///////////////////////////////
@@ -400,6 +400,56 @@ bar = "0.1.0"
400
400
assert_e2e ( ) . eq ( contents, lockfile_original) ;
401
401
}
402
402
403
+ #[ cargo_test]
404
+ fn install_not_supported ( ) {
405
+ Package :: new ( "bar" , "0.1.0" ) . publish ( ) ;
406
+ Package :: new ( "bar" , "0.1.1" )
407
+ . file ( "src/lib.rs" , "not rust" )
408
+ . publish ( ) ;
409
+ Package :: new ( "foo" , "0.1.0" )
410
+ . dep ( "bar" , "0.1" )
411
+ . file ( "src/lib.rs" , "" )
412
+ . file (
413
+ "src/main.rs" ,
414
+ "extern crate foo; extern crate bar; fn main() {}" ,
415
+ )
416
+ . file (
417
+ "Cargo.lock" ,
418
+ r#"
419
+ [[package]]
420
+ name = "bar"
421
+ version = "0.1.0"
422
+ source = "registry+https://github.com/rust-lang/crates.io-index"
423
+
424
+ [[package]]
425
+ name = "foo"
426
+ version = "0.1.0"
427
+ dependencies = [
428
+ "bar 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
429
+ ]
430
+ "# ,
431
+ )
432
+ . publish ( ) ;
433
+
434
+ cargo_process ( "install foo" )
435
+ . with_stderr_data ( str![ [ r#"
436
+ ...
437
+ [..]not rust[..]
438
+ ...
439
+ "# ] ] )
440
+ . with_status ( 101 )
441
+ . run ( ) ;
442
+ cargo_process ( "install foo -Zunstable-options --lockfile-path lockfile_dir/Cargo.lock" )
443
+ . masquerade_as_nightly_cargo ( & [ "lockfile-path" ] )
444
+ . with_stderr_data ( str![ [ r#"
445
+ ...
446
+ [ERROR] unexpected argument '--lockfile-path' found
447
+ ...
448
+ "# ] ] )
449
+ . with_status ( 1 )
450
+ . run ( ) ;
451
+ }
452
+
403
453
#[ cargo_test]
404
454
fn run_embed ( ) {
405
455
let lockfile_path = "mylockfile/Cargo.lock" ;
0 commit comments