Skip to content

Commit 1e8a4f8

Browse files
committed
fix: update test to correctly compare resolved symlink paths using canonicalization
1 parent 243bd48 commit 1e8a4f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/pet/src/find.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,12 @@ mod tests {
644644
);
645645

646646
// Extra verification: fs::canonicalize WOULD resolve it (showing the difference)
647+
// Note: We canonicalize both paths for comparison because on macOS /var is a
648+
// symlink to /private/var, so canonicalize resolves that too.
647649
let resolved = fs::canonicalize(&discovered[0]).expect("Should resolve");
650+
let canonical_target = fs::canonicalize(&deep_target).expect("Should resolve target");
648651
assert_eq!(
649-
resolved, deep_target,
652+
resolved, canonical_target,
650653
"canonicalize() would resolve to target, but path() does not"
651654
);
652655
}

0 commit comments

Comments
 (0)