mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 03:24:46 +01:00
tar: Fix symlink test when symlinks can't be created on Windows
This commit is contained in:
parent
74f361a5ce
commit
e58fea8227
1 changed files with 5 additions and 4 deletions
|
|
@ -16,6 +16,7 @@
|
|||
//! pax reference: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13
|
||||
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const Io = std.Io;
|
||||
const assert = std.debug.assert;
|
||||
const testing = std.testing;
|
||||
|
|
@ -885,10 +886,10 @@ test "create file and symlink" {
|
|||
file = try createDirAndFile(io, root.dir, "a/b/c/file2", .default_file);
|
||||
file.close(io);
|
||||
|
||||
createDirAndSymlink(io, root.dir, "a/b/c/file2", "symlink1") catch |err| {
|
||||
// On Windows when developer mode is not enabled
|
||||
if (err == error.AccessDenied) return error.SkipZigTest;
|
||||
return err;
|
||||
createDirAndSymlink(io, root.dir, "a/b/c/file2", "symlink1") catch |err| switch (err) {
|
||||
// On Windows, symlinks require developer mode/admin privileges and the underlying filesystem must support symlinks
|
||||
error.AccessDenied, error.PermissionDenied, error.FileSystem => if (builtin.os.tag == .windows) return error.SkipZigTest else return err,
|
||||
else => return err,
|
||||
};
|
||||
try createDirAndSymlink(io, root.dir, "../../../file1", "d/e/f/symlink2");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue