Skip to content

Commit d6ef648

Browse files
committed
Add more tests
1 parent 5c6801d commit d6ef648

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/suite/cli_rustup.rs

+36
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,42 @@ fn add_component_by_target_triple() {
13871387
});
13881388
}
13891389

1390+
#[test]
1391+
fn fail_invalid_component_name() {
1392+
test(&|config| {
1393+
config.with_scenario(Scenario::SimpleV2, &|config| {
1394+
config.expect_ok(&["rustup", "default", "stable"]);
1395+
config.expect_err(
1396+
&[
1397+
"rustup",
1398+
"component",
1399+
"add",
1400+
&format!("dummy-{}", clitools::CROSS_ARCH1),
1401+
],
1402+
&format!("error: toolchain 'stable-{}' does not contain component 'dummy-{}' for target '{}'",this_host_triple(), clitools::CROSS_ARCH1, this_host_triple()),
1403+
);
1404+
})
1405+
});
1406+
}
1407+
1408+
#[test]
1409+
fn fail_invalid_component_target() {
1410+
test(&|config| {
1411+
config.with_scenario(Scenario::SimpleV2, &|config| {
1412+
config.expect_ok(&["rustup", "default", "stable"]);
1413+
config.expect_err(
1414+
&[
1415+
"rustup",
1416+
"component",
1417+
"add",
1418+
"rust-std-invalid-target",
1419+
],
1420+
&format!("error: toolchain 'stable-{}' does not contain component 'rust-std-invalid-target' for target '{}'",this_host_triple(), this_host_triple()),
1421+
);
1422+
})
1423+
});
1424+
}
1425+
13901426
#[test]
13911427
fn remove_component() {
13921428
test(&|config| {

0 commit comments

Comments
 (0)