Skip to content

Commit 3aaf0ac

Browse files
committed
add tests
1 parent dd59773 commit 3aaf0ac

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/cli-v2.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
clitools::setup(Scenario::MultiHost, &|config| {
145+
let triple1 = this_host_triple();
146+
let triple2 = clitools::MULTI_ARCH1;
147+
148+
expect_ok(config, &["rustup", "toolchain", add, triple1, triple2]);
149+
expect_ok(config, &["rustup", "toolchain", "list"]);
150+
expect_stdout_ok(config, &["rustup", "toolchain", "list"], triple1);
151+
expect_stdout_ok(config, &["rustup", "toolchain", "list"], triple2);
152+
153+
expect_ok(config, &["rustup", "toolchain", rm, triple1, triple2]);
154+
expect_ok(config, &["rustup", "toolchain", "list"]);
155+
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"], triple1);
156+
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"], triple2);
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]
142168
fn remove_default_toolchain_err_handling() {
143169
setup(&|config| {

0 commit comments

Comments
 (0)