Skip to content

Commit 12870f7

Browse files
committed
test: normalize Pixi prefix assertions on Windows (Fixes #389)
1 parent 9d3b46c commit 12870f7

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

crates/pet-pixi/src/lib.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,15 @@ mod tests {
156156

157157
assert_eq!(pixi_env.kind, Some(PythonEnvironmentKind::Pixi));
158158
assert_eq!(pixi_env.name, Some("pixi-env".to_string()));
159-
assert_eq!(pixi_env.prefix, Some(prefix.clone()));
159+
assert_eq!(
160+
pixi_env
161+
.prefix
162+
.as_deref()
163+
.map(fs::canonicalize)
164+
.transpose()
165+
.unwrap(),
166+
Some(fs::canonicalize(prefix.clone()).unwrap())
167+
);
160168
assert_eq!(pixi_env.executable, Some(executable));
161169

162170
fs::remove_dir_all(prefix.parent().unwrap()).unwrap();
@@ -179,7 +187,15 @@ mod tests {
179187
let pixi_env = locator.try_from(&env).unwrap();
180188

181189
assert_eq!(pixi_env.kind, Some(PythonEnvironmentKind::Pixi));
182-
assert_eq!(pixi_env.prefix, Some(prefix.clone()));
190+
assert_eq!(
191+
pixi_env
192+
.prefix
193+
.as_deref()
194+
.map(fs::canonicalize)
195+
.transpose()
196+
.unwrap(),
197+
Some(fs::canonicalize(prefix.clone()).unwrap())
198+
);
183199

184200
fs::remove_dir_all(prefix.parent().unwrap()).unwrap();
185201
}

0 commit comments

Comments
 (0)