Skip to content

Commit 967ca55

Browse files
committed
add tests
1 parent dd59773 commit 967ca55

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/cli-v2.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,33 @@ 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+
expect_ok(config, &["rustup", "toolchain", add, "1.13.0", "1.14.0"]);
146+
expect_ok(config, &["rustup", "toolchain", "list"]);
147+
expect_stdout_ok(config, &["rustup", "toolchain", "list"],
148+
"1.13.0");
149+
expect_stdout_ok(config, &["rustup", "toolchain", "list"],
150+
"1.14.0");
151+
152+
expect_ok(config, &["rustup", "toolchain", rm, "1.13.0", "1.14.0"]);
153+
expect_ok(config, &["rustup", "toolchain", "list"]);
154+
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"],
155+
"1.13.0");
156+
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"],
157+
"1.14.0");
158+
});
159+
}
160+
161+
for add in &["add", "update", "install"] {
162+
for rm in &["remove", "uninstall"] {
163+
go(add, rm);
164+
}
165+
}
166+
}
167+
141168
#[test]
142169
fn remove_default_toolchain_err_handling() {
143170
setup(&|config| {

0 commit comments

Comments
 (0)