@@ -748,11 +748,23 @@ fn toolchain_update_is_like_update_except_that_bare_install_is_an_error() {
748
748
} ) ;
749
749
}
750
750
751
+ #[ test]
752
+ fn force_update ( ) {
753
+ setup ( & |config| {
754
+ expect_ok ( config, & [ "rustup" , "default" , "nightly" ] ) ;
755
+ expect_ok ( config, & [ "rustup" , "component" , "add" , "rustfmt-preview" ] ) ;
756
+ expect_err ( config,
757
+ & [ "rustup" , "update" ] ,
758
+ "does not contain component 'rustfmt-preview' for target" ) ;
759
+ expect_ok ( config, & [ "rustup" , "update" , "--force" ] ) ;
760
+ } ) ;
761
+ }
762
+
751
763
#[ test]
752
764
fn proxy_toolchain_shorthand ( ) {
753
765
setup ( & |config| {
754
766
expect_ok ( config, & [ "rustup" , "default" , "stable" ] ) ;
755
- expect_ok ( config, & [ "rustup" , "toolchain" , "update" , "nightly" ] ) ;
767
+ expect_ok ( config, & [ "rustup" , "toolchain" , "update" , "nightly" ] ) ;
756
768
expect_stdout_ok ( config, & [ "rustc" , "--version" ] , "hash-s-2" ) ;
757
769
expect_stdout_ok ( config, & [ "rustc" , "+stable" , "--version" ] , "hash-s-2" ) ;
758
770
expect_stdout_ok ( config, & [ "rustc" , "+nightly" , "--version" ] , "hash-n-2" ) ;
0 commit comments