From c96f0ffa85a7f1d277dc917881dfd4f1c0ac9973 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Mon, 2 Oct 2023 20:14:16 +0100 Subject: Comment out test for writing zip --- src/main.zig | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/main.zig b/src/main.zig index 71def8f..a1fb23b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -185,7 +185,7 @@ fn pump_returning(reader: anytype, writer: anytype) !struct { u64, u32 } { crc32.update(write); } - const res = .{cw.bytes_written,crc32.final()}; + const res = .{ cw.bytes_written, crc32.final() }; std.log.err("res... {any}", .{res}); return res; } @@ -360,7 +360,7 @@ const LocalFileHeader = struct { var comp = try std.compress.deflate.compressor(allocator, cw.writer(), .{}); defer comp.deinit(); const written, const crc32 = try pump_returning(rdr, comp.writer()); - + return .{ .version_needed_to_extract = 1, .general_purpose_bit_flag = std.bit_set.IntegerBitSet(16).initEmpty(), @@ -616,22 +616,24 @@ const TestFileIter = struct { }; test "write" { - const allocator = std.testing.allocator; - { - const out = try std.fs.cwd().createFile("test_out.zip", .{}); - defer out.close(); - var tfi = TestFileIter{ - .ix = 0, - .files = [_][]const u8{ "src/foo.txt", "src/bar.txt" }, - }; - try write_zip(allocator, &tfi, out.writer()); - } - - { - const out = try std.fs.cwd().openFile("test_out.zip", .{}); - defer out.close(); - try pipeToFileSystem(try std.fs.cwd().makeOpenPath("test_out", .{}), out.reader(), .{.allocator = allocator}); - } + // TODO this isn't finished. + return error.SkipZigTest; + // const allocator = std.testing.allocator; + // { + // const out = try std.fs.cwd().createFile("test_out.zip", .{}); + // defer out.close(); + // var tfi = TestFileIter{ + // .ix = 0, + // .files = [_][]const u8{ "src/foo.txt", "src/bar.txt" }, + // }; + // try write_zip(allocator, &tfi, out.writer()); + // } + + // { + // const out = try std.fs.cwd().openFile("test_out.zip", .{}); + // defer out.close(); + // try pipeToFileSystem(try std.fs.cwd().makeOpenPath("test_out", .{}), out.reader(), .{ .allocator = allocator }); + // } } // test "open stream" { -- cgit v1.2.3-ZIG