Skip to content

Commit 83f6b74

Browse files
committed
test(self-update): ensure the resolution of #3739
1 parent 0283678 commit 83f6b74

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

tests/suite/cli_self_upd.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,33 @@ info: downloading self-update
300300

301301
update_setup(&|config, _| {
302302
config.expect_ok(&["rustup-init", "-y", "--no-modify-path"]);
303+
304+
#[cfg(windows)]
305+
const RUSTUP_UNINSTALL_ENTRY: &str =
306+
r"Software\Microsoft\Windows\CurrentVersion\Uninstall\Rustup";
307+
308+
#[cfg(windows)]
309+
winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER)
310+
.open_subkey(RUSTUP_UNINSTALL_ENTRY)
311+
.unwrap()
312+
.delete_value("DisplayVersion")
313+
.unwrap();
314+
303315
config.expect_ok_ex(
304316
&["rustup", "self", "update"],
305317
&format!(" rustup updated - {version} (from {version})\n\n",),
306318
&expected_output,
307-
)
319+
);
320+
321+
#[cfg(windows)]
322+
assert_eq!(
323+
winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER)
324+
.open_subkey(RUSTUP_UNINSTALL_ENTRY)
325+
.unwrap()
326+
.get_value::<String, _>("DisplayVersion")
327+
.unwrap(),
328+
version,
329+
);
308330
});
309331
}
310332

0 commit comments

Comments
 (0)