Commit cf4936bcb0

Andrew Kelley <andrew@ziglang.org>
2020-08-05 08:45:53
std.os tests: improve robustness of "symlink with relative paths"
1 parent d159ba9
Changed files (1)
lib
std
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) {