Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
durka committed Mar 17, 2017
1 parent dd59773 commit 3aaf0ac
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/cli-v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,32 @@ fn remove_toolchain() {
});
}

#[test]
fn add_remove_multiple_toolchains() {
fn go(add: &str, rm: &str) {
clitools::setup(Scenario::MultiHost, &|config| {
let triple1 = this_host_triple();
let triple2 = clitools::MULTI_ARCH1;

expect_ok(config, &["rustup", "toolchain", add, triple1, triple2]);
expect_ok(config, &["rustup", "toolchain", "list"]);
expect_stdout_ok(config, &["rustup", "toolchain", "list"], triple1);
expect_stdout_ok(config, &["rustup", "toolchain", "list"], triple2);

expect_ok(config, &["rustup", "toolchain", rm, triple1, triple2]);
expect_ok(config, &["rustup", "toolchain", "list"]);
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"], triple1);
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"], triple2);
});
}

for add in &["add", "update", "install"] {
for rm in &["remove", "uninstall"] {
go(add, rm);
}
}
}

#[test]
fn remove_default_toolchain_err_handling() {
setup(&|config| {
Expand Down

0 comments on commit 3aaf0ac

Please sign in to comment.