Skip to content

Commit 7a64bfc

Browse files
committed
test: add env var path coverage (Refs #389)
1 parent 172d4b1 commit 7a64bfc

File tree

1 file changed

+22
-0
lines changed
  • crates/pet-env-var-path/src

1 file changed

+22
-0
lines changed

crates/pet-env-var-path/src/lib.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,26 @@ mod tests {
163163
vec![normalize_search_path(PathBuf::from("/usr/bin"))]
164164
);
165165
}
166+
167+
#[test]
168+
fn windows_apps_path_detection_is_case_insensitive_by_components() {
169+
let path = PathBuf::from(if cfg!(windows) {
170+
r"C:\Users\User\appdata\LOCAL\microsoft\WINDOWSAPPS"
171+
} else {
172+
"/Users/user/appdata/LOCAL/microsoft/WINDOWSAPPS"
173+
});
174+
175+
assert!(is_windows_apps_path(&path, None));
176+
}
177+
178+
#[test]
179+
fn windows_apps_path_detection_rejects_partial_component_matches() {
180+
let path = PathBuf::from(if cfg!(windows) {
181+
r"C:\Users\User\AppDataBackup\Local\Microsoft\WindowsApps"
182+
} else {
183+
"/Users/user/AppDataBackup/Local/Microsoft/WindowsApps"
184+
});
185+
186+
assert!(!is_windows_apps_path(&path, None));
187+
}
166188
}

0 commit comments

Comments
 (0)