Skip to content

Commit 310570b

Browse files
rami3ldjc
authored andcommitted
Add test to ensure resolution of #3418
1 parent 53d44ac commit 310570b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/suite/cli_v2.rs

+21
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,27 @@ fn update_unavailable_std() {
10341034
});
10351035
}
10361036

1037+
#[test]
1038+
fn add_missing_component() {
1039+
setup(&|config| {
1040+
make_component_unavailable(config, "rls-preview", &this_host_triple());
1041+
config.expect_ok(&["rustup", "toolchain", "add", "nightly"]);
1042+
config.expect_err(
1043+
&["rustup", "component", "add", "rls-preview"],
1044+
for_host!(
1045+
"component 'rls' for target '{0}' is unavailable for download for channel 'nightly'\n\
1046+
Sometimes not all components are available in any given nightly."
1047+
),
1048+
);
1049+
// Make sure the following pattern does not match,
1050+
// thus addressing https://github.com/rust-lang/rustup/issues/3418.
1051+
config.expect_not_stderr_err(
1052+
&["rustup", "component", "add", "rls-preview"],
1053+
"If you don't need the component, you can remove it with:",
1054+
);
1055+
});
1056+
}
1057+
10371058
#[test]
10381059
fn add_missing_component_toolchain() {
10391060
setup(&|config| {

0 commit comments

Comments
 (0)