Skip to content

Commit 3fff84a

Browse files
committed
compiler: fix unit test compile errors
sorry, zip file creation has regressed because std lib no longer has a deflate compression implementation
1 parent 6bcced3 commit 3fff84a

File tree

4 files changed

+10
-372
lines changed

4 files changed

+10
-372
lines changed

lib/std/zip.zig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,3 @@ pub fn extract(dest: std.fs.Dir, fr: *File.Reader, options: ExtractOptions) !voi
660660
}
661661
}
662662
}
663-
664-
test {
665-
_ = @import("zip/test.zig");
666-
}

lib/std/zip/test.zig

Lines changed: 0 additions & 298 deletions
This file was deleted.

src/Package/Fetch.zig

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,72 +2076,6 @@ const UnpackResult = struct {
20762076
}
20772077
};
20782078

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-
21452079
test "tarball with duplicate paths" {
21462080
// This tarball has duplicate path 'dir1/file1' to simulate case sensitve
21472081
// file system on any file sytstem.

0 commit comments

Comments
 (0)