File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,31 @@ fn adding_and_removing_packages() {
7474 assert_eq ! ( lock1, lock4) ;
7575}
7676
77+ #[ test]
78+ fn no_index_update ( ) {
79+ use cargotest:: ChannelChanger ;
80+ let p = project ( "foo" )
81+ . file ( "Cargo.toml" , r#"
82+ [package]
83+ name = "foo"
84+ authors = []
85+ version = "0.0.1"
86+
87+ [dependencies]
88+ serde = "1.0"
89+ "# )
90+ . file ( "src/main.rs" , "fn main() {}" )
91+ . build ( ) ;
92+
93+ assert_that ( p. cargo ( "generate-lockfile" ) ,
94+ execs ( ) . with_status ( 0 ) . with_stdout ( "" )
95+ . with_stderr_contains ( " Updating registry `https://github.com/rust-lang/crates.io-index`" ) ) ;
96+
97+ assert_that ( p. cargo ( "generate-lockfile" ) . masquerade_as_nightly_cargo ( ) . arg ( "-Zno-index-update" ) ,
98+ execs ( ) . with_status ( 0 ) . with_stdout ( "" )
99+ . with_stderr_does_not_contain ( " Updating registry `https://github.com/rust-lang/crates.io-index`" ) ) ;
100+ }
101+
77102#[ test]
78103fn preserve_metadata ( ) {
79104 let p = project ( "foo" )
You can’t perform that action at this time.
0 commit comments