Skip to content

Commit

Permalink
tests: Add tests for component-target support
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnison committed Oct 26, 2019
1 parent 8595201 commit 4a05a5e
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tests/cli-v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,59 @@ fn add_all_targets_fail() {
});
}

#[test]
fn add_target_by_component_add() {
setup(&|config| {
expect_ok(config, &["rustup", "default", "nightly"]);
expect_not_stdout_ok(
config,
&["rustup", "target", "list"],
&format!("{} (installed)", clitools::CROSS_ARCH1),
);
expect_ok(
config,
&[
"rustup",
"component",
"add",
&format!("rust-std-{}", clitools::CROSS_ARCH1),
],
);
expect_stdout_ok(
config,
&["rustup", "target", "list"],
&format!("{} (installed)", clitools::CROSS_ARCH1),
);
})
}

#[test]
fn remove_target_by_component_remove() {
setup(&|config| {
expect_ok(config, &["rustup", "default", "nightly"]);
expect_ok(config, &["rustup", "target", "add", clitools::CROSS_ARCH1]);
expect_stdout_ok(
config,
&["rustup", "target", "list"],
&format!("{} (installed)", clitools::CROSS_ARCH1),
);
expect_ok(
config,
&[
"rustup",
"component",
"remove",
&format!("rust-std-{}", clitools::CROSS_ARCH1),
],
);
expect_not_stdout_ok(
config,
&["rustup", "target", "list"],
&format!("{} (installed)", clitools::CROSS_ARCH1),
);
})
}

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

0 comments on commit 4a05a5e

Please sign in to comment.