From 8d0c17f5e4adf83a2a1e20f2c2230a64dad78121 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Sat, 29 Jan 2022 16:57:10 +0200 Subject: [PATCH] std: remove superfluous `.read = true` from deflate tests --- lib/std/compress/deflate/compressor_test.zig | 2 +- lib/std/compress/deflate/huffman_bit_writer.zig | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/std/compress/deflate/compressor_test.zig b/lib/std/compress/deflate/compressor_test.zig index 4e518f0e62..b35857c731 100644 --- a/lib/std/compress/deflate/compressor_test.zig +++ b/lib/std/compress/deflate/compressor_test.zig @@ -441,7 +441,7 @@ test "deflate/inflate string" { }; for (deflate_inflate_string_tests) |t| { - const golden_file = try testdata_dir.openFile(t.filename, .{ .read = true }); + const golden_file = try testdata_dir.openFile(t.filename, .{}); defer golden_file.close(); var golden = try golden_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize)); defer testing.allocator.free(golden); diff --git a/lib/std/compress/deflate/huffman_bit_writer.zig b/lib/std/compress/deflate/huffman_bit_writer.zig index e8ace3422e..3578462181 100644 --- a/lib/std/compress/deflate/huffman_bit_writer.zig +++ b/lib/std/compress/deflate/huffman_bit_writer.zig @@ -892,9 +892,9 @@ fn testBlockHuff(in_name: []const u8, want_name: []const u8) !void { const current_dir = try std.fs.openDirAbsolute(std.fs.path.dirname(@src().file).?, .{}); const testdata_dir = try current_dir.openDir("testdata", .{}); - const in_file = try testdata_dir.openFile(in_name, .{ .read = true }); + const in_file = try testdata_dir.openFile(in_name, .{}); defer in_file.close(); - const want_file = try testdata_dir.openFile(want_name, .{ .read = true }); + const want_file = try testdata_dir.openFile(want_name, .{}); defer want_file.close(); var in = try in_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize)); @@ -1630,11 +1630,11 @@ fn testBlock(comptime ht: HuffTest, ttype: TestType) !void { defer testing.allocator.free(want_name); if (!mem.eql(u8, ht.input, "")) { - const in_file = try testdata_dir.openFile(ht.input, .{ .read = true }); + const in_file = try testdata_dir.openFile(ht.input, .{}); input = try in_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize)); defer testing.allocator.free(input); - const want_file = try testdata_dir.openFile(want_name, .{ .read = true }); + const want_file = try testdata_dir.openFile(want_name, .{}); want = try want_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize)); defer testing.allocator.free(want); @@ -1663,7 +1663,7 @@ fn testBlock(comptime ht: HuffTest, ttype: TestType) !void { want_name_no_input = try fmt.allocPrint(testing.allocator, ht.want_no_input, .{ttype.to_s()}); defer testing.allocator.free(want_name_no_input); - const want_no_input_file = try testdata_dir.openFile(want_name_no_input, .{ .read = true }); + const want_no_input_file = try testdata_dir.openFile(want_name_no_input, .{}); want_ni = try want_no_input_file.reader().readAllAlloc(testing.allocator, math.maxInt(usize)); defer testing.allocator.free(want_ni);