mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
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:
1 parent
349a03b6b1
commit
7fc39a61c1
1 file changed
+1
-2
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user