Tests: the CLI render-out test compares canonical temp paths

macOS's /var is a symlink to /private/var: the CLI resolves its working
directory through current_dir(), which is canonical, so the recorded
output path was /private/var/... while the test expected /var/....
Canonicalise the test's temp directory so the comparison holds on macOS.
This commit is contained in:
Aavirash committed 2026-10-10 12:13:21 +02:00
1 parent 0d2264dbed
commit a2554c404c
1 file changed
+3 -1
+3 -1
View File
@@ -28,7 +28,9 @@ fn ok_json(args: &[&str]) -> Value {
fn tmp(name: &str) -> PathBuf {
let d = std::env::temp_dir().join(format!("ec-cli-test-{}", std::process::id()));
std::fs::create_dir_all(&d).unwrap();
d.join(name)
// macOS's `/var` is a symlink to `/private/var`: a child process resolves its working
// directory through `current_dir()`, which is canonical, so compare canonical paths.
std::fs::canonicalize(&d).unwrap_or(d).join(name)
}
#[test]