From 1eab812206f3b3522fcfe756d8fa9ec640fb84fd Mon Sep 17 00:00:00 2001 From: Simone <79767264+smonicas@users.noreply.github.com> Date: Fri, 16 Jun 2023 14:47:27 +0200 Subject: [PATCH] Fix glob! input_file on Windows (#371) --- src/runtime.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime.rs b/src/runtime.rs index 4efbc7c5..1768179b 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -315,9 +315,10 @@ impl<'a> SnapshotAssertionContext<'a> { .canonicalize() .ok() .and_then(|s| { - s.strip_prefix(self.cargo_workspace.as_path()) + self.cargo_workspace + .canonicalize() .ok() - .map(|x| x.to_path_buf()) + .and_then(|cw| s.strip_prefix(cw).ok().map(|x| x.to_path_buf())) }) }