srctree

Igor Anić parent 30a319be f086ea85
std.tar skip test on windows

Or other platform which don't support symlinks.

inlinesplit
lib/std/tar.zig added: 9, removed: 5, total 4
@@ -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),
 
lib/std/tar/test.zig added: 9, removed: 5, total 4
@@ -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);