Caller-space test queries the temp directory, not its drive root

A temp folder on a volume mounted without a drive letter has a root on a
different volume, so the comparison could fail on correct code.
This commit is contained in:
Khawar Zamman Wani committed 2026-11-06 14:57:19 +05:30
1 parent 349a03b6b1
commit 7fc39a61c1
1 file changed
+1 -2
+1 -2
View File
@@ -895,11 +895,10 @@ mod tests {
fn available_to_caller_reads_the_temp_volume() {
let temp = std::fs::canonicalize(std::env::temp_dir()).unwrap();
let temp = without_verbatim_disk_prefix(&temp).unwrap_or(temp);
let root = temp.ancestors().last().unwrap();
let mut temp_volume_total = 0;
winsafe::GetDiskFreeSpaceEx(Some(temp.to_str().unwrap()), None, Some(&mut temp_volume_total), None).unwrap();
assert!(temp_volume_total > 0);
assert!(available_to_caller(root).unwrap() <= temp_volume_total);
assert!(available_to_caller(&temp).unwrap() <= temp_volume_total);
}
#[test]