mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
std.tar skip test on windows
Or other platform which don't support symlinks.
This commit is contained in:
parent
30a319be6d
commit
f086ea856c
@ -564,7 +564,7 @@ pub fn pipeToFileSystem(dir: std.fs.Dir, reader: anytype, options: Options) !voi
|
||||
const link_name = file.link_name;
|
||||
|
||||
createDirAndSymlink(dir, link_name, file_name) catch |err| {
|
||||
const d = options.diagnostics orelse return err;
|
||||
const d = options.diagnostics orelse return error.UnableToCreateSymLink;
|
||||
try d.errors.append(d.allocator, .{ .unable_to_create_sym_link = .{
|
||||
.code = err,
|
||||
.file_name = try d.allocator.dupe(u8, file_name),
|
||||
|
||||
@ -467,11 +467,15 @@ test "tar pipeToFileSystem" {
|
||||
var root = std.testing.tmpDir(.{ .no_follow = true });
|
||||
defer root.cleanup();
|
||||
|
||||
try tar.pipeToFileSystem(root.dir, fsb.reader(), .{
|
||||
tar.pipeToFileSystem(root.dir, fsb.reader(), .{
|
||||
.mode_mode = .ignore,
|
||||
.strip_components = 1,
|
||||
.exclude_empty_directories = true,
|
||||
});
|
||||
}) catch |err| {
|
||||
// Skip on platform which don't support symlinks
|
||||
if (err == error.UnableToCreateSymLink) return error.SkipZigTest;
|
||||
return err;
|
||||
};
|
||||
|
||||
try testing.expectError(error.FileNotFound, root.dir.statFile("empty"));
|
||||
try testing.expect((try root.dir.statFile("a/file")).kind == .file);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user