Fix more tests

This commit is contained in:
Caelan Sayler
2025-05-18 23:15:13 +01:00
committed by Caelan
parent 4ba66223d5
commit f76a69d946
3 changed files with 5 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ pub fn uninstall(locator: &VelopackLocator, delete_self: bool) -> Result<()> {
windows::remove_all_shortcuts_for_root_dir(&root_path); windows::remove_all_shortcuts_for_root_dir(&root_path);
info!("Removing directory '{}'", root_path.to_string_lossy()); info!("Removing directory '{}'", root_path.to_string_lossy());
let _ = remove_dir_all::remove_dir_all(&root_path); let _ = remove_dir_all::remove_dir_contents(&root_path);
if let Err(e) = windows::registry::remove_uninstall_entry(&locator) { if let Err(e) = windows::registry::remove_uninstall_entry(&locator) {
error!("Unable to remove uninstall registry entry ({}).", e); error!("Unable to remove uninstall registry entry ({}).", e);

View File

@@ -498,7 +498,7 @@ fn test_dotnet_detects_installed_versions() {
assert!(parse_dotnet_version("net8-runtime").unwrap().is_installed()); assert!(parse_dotnet_version("net8-runtime").unwrap().is_installed());
assert!(parse_dotnet_version("net8-desktop").unwrap().is_installed()); assert!(parse_dotnet_version("net8-desktop").unwrap().is_installed());
assert!(parse_dotnet_version("net8-asp").unwrap().is_installed()); assert!(parse_dotnet_version("net8-asp").unwrap().is_installed());
assert!(parse_dotnet_version("net8-sdk").unwrap().is_installed()); assert!(parse_dotnet_version("net9-sdk").unwrap().is_installed());
assert!(!parse_dotnet_version("net11").unwrap().is_installed()); assert!(!parse_dotnet_version("net11").unwrap().is_installed());
} }

View File

@@ -95,9 +95,9 @@ pub fn expand_environment_strings<P: AsRef<str>>(input: P) -> Result<String> {
#[test] #[test]
fn test_expand_environment_strings() { fn test_expand_environment_strings() {
assert_eq!(expand_environment_strings("%windir%").unwrap(), "C:\\Windows"); assert!(expand_environment_strings("%windir%").unwrap().eq_ignore_ascii_case("C:\\Windows"));
assert_eq!(expand_environment_strings("%windir%\\system32").unwrap(), "C:\\Windows\\system32"); assert!(expand_environment_strings("%windir%\\system32").unwrap().eq_ignore_ascii_case("C:\\Windows\\system32"));
assert_eq!(expand_environment_strings("%windir%\\system32\\").unwrap(), "C:\\Windows\\system32\\"); assert!(expand_environment_strings("%windir%\\system32\\").unwrap().eq_ignore_ascii_case("C:\\Windows\\system32\\"));
} }
pub fn get_long_path<P: AsRef<str>>(str: P) -> Result<String> { pub fn get_long_path<P: AsRef<str>>(str: P) -> Result<String> {