@@ -138,6 +138,32 @@ fn remove_toolchain() {
138138 } ) ;
139139}
140140
141+ #[ test]
142+ fn add_remove_multiple_toolchains ( ) {
143+ fn go ( add : & str , rm : & str ) {
144+ setup ( & |config| {
145+ let tch1 = "beta" ;
146+ let tch2 = "nightly" ;
147+
148+ expect_ok ( config, & [ "rustup" , "toolchain" , add, tch1, tch2] ) ;
149+ expect_ok ( config, & [ "rustup" , "toolchain" , "list" ] ) ;
150+ expect_stdout_ok ( config, & [ "rustup" , "toolchain" , "list" ] , tch1) ;
151+ expect_stdout_ok ( config, & [ "rustup" , "toolchain" , "list" ] , tch2) ;
152+
153+ expect_ok ( config, & [ "rustup" , "toolchain" , rm, tch1, tch2] ) ;
154+ expect_ok ( config, & [ "rustup" , "toolchain" , "list" ] ) ;
155+ expect_not_stdout_ok ( config, & [ "rustup" , "toolchain" , "list" ] , tch1) ;
156+ expect_not_stdout_ok ( config, & [ "rustup" , "toolchain" , "list" ] , tch2) ;
157+ } ) ;
158+ }
159+
160+ for add in & [ "add" , "update" , "install" ] {
161+ for rm in & [ "remove" , "uninstall" ] {
162+ go ( add, rm) ;
163+ }
164+ }
165+ }
166+
141167#[ test]
142168fn remove_default_toolchain_err_handling ( ) {
143169 setup ( & |config| {
0 commit comments