From cf4936bcb0d48df5578efe76156c5c7ffc0d7b1e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 4 Aug 2020 23:45:53 -0700 Subject: [PATCH] std.os tests: improve robustness of "symlink with relative paths" --- lib/std/os/test.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig index b39e239ed4..b17ddfaf7e 100644 --- a/lib/std/os/test.zig +++ b/lib/std/os/test.zig @@ -112,8 +112,11 @@ test "openat smoke test" { test "symlink with relative paths" { if (builtin.os.tag == .wasi) return error.SkipZigTest; + const cwd = fs.cwd(); + cwd.deleteFile("file.txt") catch {}; + cwd.deleteFile("symlinked") catch {}; + // First, try relative paths in cwd - var cwd = fs.cwd(); try cwd.writeFile("file.txt", "nonsense"); if (builtin.os.tag == .windows) {