From 87c81bef872e3c85a1ad3950855ac3c87a99677c Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 12 Apr 2024 21:24:21 +0800 Subject: [PATCH] test(self-update): ensure the resolution of #3739 --- tests/suite/cli_self_upd.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/suite/cli_self_upd.rs b/tests/suite/cli_self_upd.rs index e9cba3bc38b..6b8d1243712 100644 --- a/tests/suite/cli_self_upd.rs +++ b/tests/suite/cli_self_upd.rs @@ -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::("DisplayVersion") + .unwrap(), + version, + ); }); }