authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-02-07 13:21:24-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-03-01 15:01:51-08:00
loge58fea8227828c0653d687b3baac785ae0564bcd
treec500f5aaa67ae90248b7683f31e111e9e1a5f2af
parent74f361a5ce5212ce321fd0ebfa4c158468a161bb

tar: Fix symlink test when symlinks can't be created on Windows


1 files changed, 5 insertions(+), 4 deletions(-)

lib/std/tar.zig+5-4
......@@ -16,6 +16,7 @@
1616//! pax reference: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13
1717
1818const std = @import("std");
19const builtin = @import("builtin");
1920const Io = std.Io;
2021const assert = std.debug.assert;
2122const testing = std.testing;
......@@ -885,10 +886,10 @@ test "create file and symlink" {
885886 file = try createDirAndFile(io, root.dir, "a/b/c/file2", .default_file);
886887 file.close(io);
887888
888 createDirAndSymlink(io, root.dir, "a/b/c/file2", "symlink1") catch |err| {
889 // On Windows when developer mode is not enabled
890 if (err == error.AccessDenied) return error.SkipZigTest;
891 return err;
889 createDirAndSymlink(io, root.dir, "a/b/c/file2", "symlink1") catch |err| switch (err) {
890 // On Windows, symlinks require developer mode/admin privileges and the underlying filesystem must support symlinks
891 error.AccessDenied, error.PermissionDenied, error.FileSystem => if (builtin.os.tag == .windows) return error.SkipZigTest else return err,
892 else => return err,
892893 };
893894 try createDirAndSymlink(io, root.dir, "../../../file1", "d/e/f/symlink2");
894895