@@ -9,7 +9,7 @@ use cargo_test_support::install::{
9
9
assert_has_installed_exe, assert_has_not_installed_exe, cargo_home,
10
10
} ;
11
11
use cargo_test_support:: paths;
12
- use cargo_test_support:: registry:: Package ;
12
+ use cargo_test_support:: registry:: { registry_path , registry_url , Package } ;
13
13
use cargo_test_support:: {
14
14
basic_manifest, cargo_process, no_such_file_err_msg, project, symlink_supported, t,
15
15
} ;
@@ -51,6 +51,35 @@ fn simple() {
51
51
assert_has_not_installed_exe ( cargo_home ( ) , "foo" ) ;
52
52
}
53
53
54
+ #[ cargo_test]
55
+ fn with_index ( ) {
56
+ pkg ( "foo" , "0.0.1" ) ;
57
+
58
+ cargo_process ( "install foo --index" )
59
+ . arg ( registry_url ( ) . to_string ( ) )
60
+ . with_stderr ( & format ! (
61
+ "\
62
+ [UPDATING] `{reg}` index
63
+ [DOWNLOADING] crates ...
64
+ [DOWNLOADED] foo v0.0.1 (registry `{reg}`)
65
+ [INSTALLING] foo v0.0.1 (registry `{reg}`)
66
+ [COMPILING] foo v0.0.1 (registry `{reg}`)
67
+ [FINISHED] release [optimized] target(s) in [..]
68
+ [INSTALLING] [CWD]/home/.cargo/bin/foo[EXE]
69
+ [INSTALLED] package `foo v0.0.1 (registry `{reg}`)` (executable `foo[EXE]`)
70
+ [WARNING] be sure to add `[..]` to your PATH to be able to run the installed binaries
71
+ " ,
72
+ reg = registry_path( ) . to_str( ) . unwrap( )
73
+ ) )
74
+ . run ( ) ;
75
+ assert_has_installed_exe ( cargo_home ( ) , "foo" ) ;
76
+
77
+ cargo_process ( "uninstall foo" )
78
+ . with_stderr ( "[REMOVING] [CWD]/home/.cargo/bin/foo[EXE]" )
79
+ . run ( ) ;
80
+ assert_has_not_installed_exe ( cargo_home ( ) , "foo" ) ;
81
+ }
82
+
54
83
#[ cargo_test]
55
84
fn multiple_pkgs ( ) {
56
85
pkg ( "foo" , "0.0.1" ) ;
0 commit comments