mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-14 19:27:05 -04:00
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:
1 parent
0d2264dbed
commit
a2554c404c
1 file changed
+3
-1
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user