@@ -2076,72 +2076,6 @@ const UnpackResult = struct {
2076
2076
}
2077
2077
};
2078
2078
2079
- test "zip" {
2080
- const gpa = std .testing .allocator ;
2081
- var tmp = std .testing .tmpDir (.{});
2082
- defer tmp .cleanup ();
2083
-
2084
- const test_files = [_ ]std.zip.testutil.File {
2085
- .{ .name = "foo" , .content = "this is just foo\n " , .compression = .store },
2086
- .{ .name = "bar" , .content = "another file\n " , .compression = .deflate },
2087
- };
2088
- {
2089
- var zip_file = try tmp .dir .createFile ("test.zip" , .{});
2090
- defer zip_file .close ();
2091
- var bw = std .io .bufferedWriter (zip_file .deprecatedWriter ());
2092
- var store : [test_files .len ]std.zip.testutil.FileStore = undefined ;
2093
- try std .zip .testutil .writeZip (bw .writer (), & test_files , & store , .{});
2094
- try bw .flush ();
2095
- }
2096
-
2097
- const zip_path = try std .fmt .allocPrint (gpa , ".zig-cache/tmp/{s}/test.zip" , .{tmp .sub_path });
2098
- defer gpa .free (zip_path );
2099
-
2100
- var fb : TestFetchBuilder = undefined ;
2101
- var fetch = try fb .build (gpa , tmp .dir , zip_path );
2102
- defer fb .deinit ();
2103
-
2104
- try fetch .run ();
2105
-
2106
- var out = try fb .packageDir ();
2107
- defer out .close ();
2108
-
2109
- try std .zip .testutil .expectFiles (& test_files , out , .{});
2110
- }
2111
-
2112
- test "zip with one root folder" {
2113
- const gpa = std .testing .allocator ;
2114
- var tmp = std .testing .tmpDir (.{});
2115
- defer tmp .cleanup ();
2116
-
2117
- const test_files = [_ ]std.zip.testutil.File {
2118
- .{ .name = "the_root_folder/foo.zig" , .content = "// this is foo.zig\n " , .compression = .store },
2119
- .{ .name = "the_root_folder/README.md" , .content = "# The foo.zig README\n " , .compression = .store },
2120
- };
2121
- {
2122
- var zip_file = try tmp .dir .createFile ("test.zip" , .{});
2123
- defer zip_file .close ();
2124
- var bw = std .io .bufferedWriter (zip_file .deprecatedWriter ());
2125
- var store : [test_files .len ]std.zip.testutil.FileStore = undefined ;
2126
- try std .zip .testutil .writeZip (bw .writer (), & test_files , & store , .{});
2127
- try bw .flush ();
2128
- }
2129
-
2130
- const zip_path = try std .fmt .allocPrint (gpa , ".zig-cache/tmp/{s}/test.zip" , .{tmp .sub_path });
2131
- defer gpa .free (zip_path );
2132
-
2133
- var fb : TestFetchBuilder = undefined ;
2134
- var fetch = try fb .build (gpa , tmp .dir , zip_path );
2135
- defer fb .deinit ();
2136
-
2137
- try fetch .run ();
2138
-
2139
- var out = try fb .packageDir ();
2140
- defer out .close ();
2141
-
2142
- try std .zip .testutil .expectFiles (& test_files , out , .{ .strip_prefix = "the_root_folder/" });
2143
- }
2144
-
2145
2079
test "tarball with duplicate paths" {
2146
2080
// This tarball has duplicate path 'dir1/file1' to simulate case sensitve
2147
2081
// file system on any file sytstem.
0 commit comments