Skip to content

Commit 6e56657

Browse files
committed
add test for toolchain uninstallation
1 parent f6b0f59 commit 6e56657

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tests/suite/cli_self_upd.rs

+18-2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ fn uninstall_deletes_bins() {
153153
});
154154
}
155155

156+
#[test]
157+
fn uninstall_deletes_installed_toolchains() {
158+
setup_installed(&|config| {
159+
let path = config.customdir.join("custom-1");
160+
let path = path.to_string_lossy();
161+
config.expect_ok(&["rustup", "toolchain", "link", "custom", &path]);
162+
config.expect_ok_contains(&["rustup", "self", "uninstall", "-y"],
163+
"",
164+
r"
165+
info: uninstalling toolchain 'custom'
166+
info: toolchain 'custom' uninstalled
167+
");
168+
assert!(!&config.rustupdir.join("toolchains").exists())
169+
});
170+
}
171+
156172
#[test]
157173
fn uninstall_works_if_some_bins_dont_exist() {
158174
setup_empty_installed(&|config| {
@@ -278,13 +294,13 @@ fn update_exact() {
278294
let expected_output = "info: checking for self-update
279295
info: downloading self-update
280296
"
281-
.to_string();
297+
.to_string();
282298

283299
update_setup(&|config, _| {
284300
config.expect_ok(&["rustup-init", "-y", "--no-modify-path"]);
285301
config.expect_ok_ex(
286302
&["rustup", "self", "update"],
287-
&format!(" rustup updated - {version} (from {version})\n\n",),
303+
&format!(" rustup updated - {version} (from {version})\n\n", ),
288304
&expected_output,
289305
)
290306
});

0 commit comments

Comments
 (0)