commit cf4936bcb0d48df5578efe76156c5c7ffc0d7b1e (tree)
parent d159ba9295b331663a62438673f3543c35fca136
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 4 Aug 2020 23:45:53 -0700
std.os tests: improve robustness of "symlink with relative paths"
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git 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) {