authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-01-29 16:57:10+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-01-29 16:57:10+02:00
log8d0c17f5e4adf83a2a1e20f2c2230a64dad78121
tree6b4cd2e9c487fc60f32a1b4f2651500fb9d97523
parent9f16d9ed07275209946b9e733c30be1bb0a1ae33

std: remove superfluous `.read = true` from deflate tests


2 files changed, 6 insertions(+), 6 deletions(-)

lib/std/compress/deflate/compressor_test.zig+1-1
...@@ -441,7 +441,7 @@ test "deflate/inflate string" {...@@ -441,7 +441,7 @@ test "deflate/inflate string" {
441 };441 };
442442
443 for (deflate_inflate_string_tests) |t| {443 for (deflate_inflate_string_tests) |t| {
444 const golden_file = try testdata_dir.openFile(t.filename, .{ .read = true });444 const golden_file = try testdata_dir.openFile(t.filename, .{});
445 defer golden_file.close();445 defer golden_file.close();
446 var golden = try golden_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));446 var golden = try golden_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));
447 defer testing.allocator.free(golden);447 defer testing.allocator.free(golden);
lib/std/compress/deflate/huffman_bit_writer.zig+5-5
...@@ -892,9 +892,9 @@ fn testBlockHuff(in_name: []const u8, want_name: []const u8) !void {...@@ -892,9 +892,9 @@ fn testBlockHuff(in_name: []const u8, want_name: []const u8) !void {
892892
893 const current_dir = try std.fs.openDirAbsolute(std.fs.path.dirname(@src().file).?, .{});893 const current_dir = try std.fs.openDirAbsolute(std.fs.path.dirname(@src().file).?, .{});
894 const testdata_dir = try current_dir.openDir("testdata", .{});894 const testdata_dir = try current_dir.openDir("testdata", .{});
895 const in_file = try testdata_dir.openFile(in_name, .{ .read = true });895 const in_file = try testdata_dir.openFile(in_name, .{});
896 defer in_file.close();896 defer in_file.close();
897 const want_file = try testdata_dir.openFile(want_name, .{ .read = true });897 const want_file = try testdata_dir.openFile(want_name, .{});
898 defer want_file.close();898 defer want_file.close();
899899
900 var in = try in_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));900 var in = try in_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));
...@@ -1630,11 +1630,11 @@ fn testBlock(comptime ht: HuffTest, ttype: TestType) !void {...@@ -1630,11 +1630,11 @@ fn testBlock(comptime ht: HuffTest, ttype: TestType) !void {
1630 defer testing.allocator.free(want_name);1630 defer testing.allocator.free(want_name);
16311631
1632 if (!mem.eql(u8, ht.input, "")) {1632 if (!mem.eql(u8, ht.input, "")) {
1633 const in_file = try testdata_dir.openFile(ht.input, .{ .read = true });1633 const in_file = try testdata_dir.openFile(ht.input, .{});
1634 input = try in_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));1634 input = try in_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));
1635 defer testing.allocator.free(input);1635 defer testing.allocator.free(input);
16361636
1637 const want_file = try testdata_dir.openFile(want_name, .{ .read = true });1637 const want_file = try testdata_dir.openFile(want_name, .{});
1638 want = try want_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));1638 want = try want_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));
1639 defer testing.allocator.free(want);1639 defer testing.allocator.free(want);
16401640
...@@ -1663,7 +1663,7 @@ fn testBlock(comptime ht: HuffTest, ttype: TestType) !void {...@@ -1663,7 +1663,7 @@ fn testBlock(comptime ht: HuffTest, ttype: TestType) !void {
1663 want_name_no_input = try fmt.allocPrint(testing.allocator, ht.want_no_input, .{ttype.to_s()});1663 want_name_no_input = try fmt.allocPrint(testing.allocator, ht.want_no_input, .{ttype.to_s()});
1664 defer testing.allocator.free(want_name_no_input);1664 defer testing.allocator.free(want_name_no_input);
16651665
1666 const want_no_input_file = try testdata_dir.openFile(want_name_no_input, .{ .read = true });1666 const want_no_input_file = try testdata_dir.openFile(want_name_no_input, .{});
1667 want_ni = try want_no_input_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));1667 want_ni = try want_no_input_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize));
1668 defer testing.allocator.free(want_ni);1668 defer testing.allocator.free(want_ni);
16691669