aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-08-04 23:45:53 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-08-04 23:45:53 -0700
commitcf4936bcb0d48df5578efe76156c5c7ffc0d7b1e (patch)
treee54d31ee65b7fcc1d47779969b6dd192e3418128 /lib/std/os
parentd159ba9295b331663a62438673f3543c35fca136 (diff)
downloadzig-cf4936bcb0d48df5578efe76156c5c7ffc0d7b1e.tar.gz
zig-cf4936bcb0d48df5578efe76156c5c7ffc0d7b1e.zip
std.os tests: improve robustness of "symlink with relative paths"
Diffstat (limited to 'lib/std/os')
-rw-r--r--lib/std/os/test.zig5
1 files changed, 4 insertions, 1 deletions
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) {