@@ -715,6 +715,38 @@ fn rustup_self_updates() {
715715 } )
716716}
717717
718+ #[ test]
719+ fn rustup_self_updates_with_specified_toolchain ( ) {
720+ update_setup ( & |config, _| {
721+ expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
722+
723+ let ref bin = config. cargodir . join ( & format ! ( "bin/rustup{}" , EXE_SUFFIX ) ) ;
724+ let before_hash = calc_hash ( bin) ;
725+
726+ expect_ok ( config, & [ "rustup" , "update" , "stable" ] ) ;
727+
728+ let after_hash = calc_hash ( bin) ;
729+
730+ assert_ne ! ( before_hash, after_hash) ;
731+ } )
732+ }
733+
734+ #[ test]
735+ fn rustup_no_self_update_with_specified_toolchain ( ) {
736+ update_setup ( & |config, _| {
737+ expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
738+
739+ let ref bin = config. cargodir . join ( & format ! ( "bin/rustup{}" , EXE_SUFFIX ) ) ;
740+ let before_hash = calc_hash ( bin) ;
741+
742+ expect_ok ( config, & [ "rustup" , "update" , "stable" , "--no-self-update" ] ) ;
743+
744+ let after_hash = calc_hash ( bin) ;
745+
746+ assert_eq ! ( before_hash, after_hash) ;
747+ } )
748+ }
749+
718750#[ test]
719751fn rustup_self_update_exact ( ) {
720752 update_setup ( & |config, _| {
0 commit comments