Commit f8e42d6b30

Igor Anić <igor.anic@gmail.com>
2023-12-11 22:17:47
tar: add Go test case files to the project
1 parent c07527a
lib/std/tar.zig
@@ -618,10 +618,8 @@ test "tar run Go test cases" {
         err: ?anyerror = null, // parsing should fail with this error
     };
 
-    const test_dir = if (std.os.getenv("GO_TAR_TESTDATA_PATH")) |path|
-        try std.fs.openDirAbsolute(path, .{})
-    else
-        return error.SkipZigTest;
+    const src_path = comptime std.fs.path.dirname(@src().file) orelse ".";
+    const test_dir = try std.fs.cwd().openDir(src_path ++ "/../../test/cases/tar", .{});
 
     const cases = [_]Case{
         .{
@@ -921,9 +919,9 @@ test "tar run Go test cases" {
 
     for (cases) |case| {
         var fs_file = try test_dir.openFile(case.path, .{});
+
         defer fs_file.close();
 
-        //var iter = iterator(fs_file.reader(), null);
         var iter = tarReader(fs_file.reader(), null);
         var i: usize = 0;
         while (iter.next() catch |err| {
test/cases/tar/gnu-incremental.tar
Binary file
test/cases/tar/gnu-long-nul.tar
Binary file
test/cases/tar/gnu-multi-hdrs.tar
Binary file
test/cases/tar/gnu-not-utf8.tar
Binary file
test/cases/tar/gnu-utf8.tar
Binary file
test/cases/tar/gnu.tar
Binary file
test/cases/tar/invalid-go17.tar
Binary file
test/cases/tar/issue10968.tar
Binary file
test/cases/tar/issue11169.tar
Binary file
test/cases/tar/issue12435.tar
Binary file
test/cases/tar/neg-size.tar
Binary file
test/cases/tar/nil-uid.tar
Binary file
test/cases/tar/pax-bad-hdr-file.tar
Binary file
test/cases/tar/pax-global-records.tar
Binary file
test/cases/tar/pax-multi-hdrs.tar
Binary file
test/cases/tar/pax-nul-path.tar
Binary file
test/cases/tar/pax-nul-xattrs.tar
Binary file
test/cases/tar/pax-pos-size-file.tar
Binary file
test/cases/tar/pax-records.tar
Binary file
test/cases/tar/pax.tar
Binary file
test/cases/tar/sparse-formats.tar
Binary file
test/cases/tar/star.tar
Binary file
test/cases/tar/trailing-slash.tar
Binary file
test/cases/tar/ustar-file-devs.tar
Binary file
test/cases/tar/v7.tar
Binary file
test/cases/tar/writer-big-long.tar
Binary file
test/cases/tar/writer-big.tar
Binary file
test/cases/tar/xattrs.tar
Binary file