Skip to content

Commit

Permalink
Farm depth must use canonical path
Browse files Browse the repository at this point in the history
Because on MacOS there's a symlink here
  • Loading branch information
tesujimath committed Jun 25, 2024
1 parent 79e7bfc commit 74bb93f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ impl LinkFarm {
// return how many levels below root is the top of the link farm
pub fn depth_below_root(&self) -> usize {
use Component::*;
let depth = self
.tempdir
.path()
let canonical_path = self.tempdir.path().canonicalize().unwrap();
let depth = canonical_path
.components()
.filter(|c| matches!(c, Normal(_)))
.count();

println!(
"depth_below_root for {:?} is {}",
"depth_below_root for {:?} with canonical {:?} is {}",
self.tempdir.path(),
canonical_path,
depth
);
depth
Expand Down

0 comments on commit 74bb93f

Please sign in to comment.