| ... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
| 16 | //! pax reference: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13 | 16 | //! pax reference: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13 |
| 17 | | 17 | |
| 18 | const std = @import("std"); | 18 | const std = @import("std"); |
| | 19 | const builtin = @import("builtin"); |
| 19 | const Io = std.Io; | 20 | const Io = std.Io; |
| 20 | const assert = std.debug.assert; | 21 | const assert = std.debug.assert; |
| 21 | const testing = std.testing; | 22 | const testing = std.testing; |
| ... | @@ -885,10 +886,10 @@ test "create file and symlink" { | ... | @@ -885,10 +886,10 @@ test "create file and symlink" { |
| 885 | file = try createDirAndFile(io, root.dir, "a/b/c/file2", .default_file); | 886 | file = try createDirAndFile(io, root.dir, "a/b/c/file2", .default_file); |
| 886 | file.close(io); | 887 | file.close(io); |
| 887 | | 888 | |
| 888 | createDirAndSymlink(io, root.dir, "a/b/c/file2", "symlink1") catch |err| { | 889 | createDirAndSymlink(io, root.dir, "a/b/c/file2", "symlink1") catch |err| switch (err) { |
| 889 | // On Windows when developer mode is not enabled | 890 | // On Windows, symlinks require developer mode/admin privileges and the underlying filesystem must support symlinks |
| 890 | if (err == error.AccessDenied) return error.SkipZigTest; | 891 | error.AccessDenied, error.PermissionDenied, error.FileSystem => if (builtin.os.tag == .windows) return error.SkipZigTest else return err, |
| 891 | return err; | 892 | else => return err, |
| 892 | }; | 893 | }; |
| 893 | try createDirAndSymlink(io, root.dir, "../../../file1", "d/e/f/symlink2"); | 894 | try createDirAndSymlink(io, root.dir, "../../../file1", "d/e/f/symlink2"); |
| 894 | | 895 | |