Skip to content

Commit

Permalink
test(self-update): ensure the resolution of #3739
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Apr 13, 2024
1 parent 0283678 commit 87c81be
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/suite/cli_self_upd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,33 @@ info: downloading self-update

update_setup(&|config, _| {
config.expect_ok(&["rustup-init", "-y", "--no-modify-path"]);

#[cfg(windows)]
const RUSTUP_UNINSTALL_ENTRY: &str =
r"Software\Microsoft\Windows\CurrentVersion\Uninstall\Rustup";

#[cfg(windows)]
winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER)
.create_subkey(RUSTUP_UNINSTALL_ENTRY)
.unwrap()
.delete_value("DisplayVersion")
.unwrap();

config.expect_ok_ex(
&["rustup", "self", "update"],
&format!(" rustup updated - {version} (from {version})\n\n",),
&expected_output,
)
);

#[cfg(windows)]
assert_eq!(
winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER)
.open_subkey(RUSTUP_UNINSTALL_ENTRY)
.unwrap()
.get_value::<String, _>("DisplayVersion")
.unwrap(),
version,
);
});
}

Expand Down

0 comments on commit 87c81be

Please sign in to comment.