aboutsummaryrefslogtreecommitdiff
path: root/lib/std/io/test.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/io/test.zig')
-rw-r--r--lib/std/io/test.zig16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/std/io/test.zig b/lib/std/io/test.zig
index 6505fcd4fa..523b25c9c8 100644
--- a/lib/std/io/test.zig
+++ b/lib/std/io/test.zig
@@ -108,10 +108,7 @@ test "File seek ops" {
const tmp_file_name = "temp_test_file.txt";
var file = try tmp.dir.createFile(tmp_file_name, .{});
- defer {
- file.close();
- tmp.dir.deleteFile(tmp_file_name) catch {};
- }
+ defer file.close();
try file.writeAll(&([_]u8{0x55} ** 8192));
@@ -135,10 +132,7 @@ test "setEndPos" {
const tmp_file_name = "temp_test_file.txt";
var file = try tmp.dir.createFile(tmp_file_name, .{});
- defer {
- file.close();
- tmp.dir.deleteFile(tmp_file_name) catch {};
- }
+ defer file.close();
// Verify that the file size changes and the file offset is not moved
try std.testing.expect((try file.getEndPos()) == 0);
@@ -161,10 +155,8 @@ test "updateTimes" {
const tmp_file_name = "just_a_temporary_file.txt";
var file = try tmp.dir.createFile(tmp_file_name, .{ .read = true });
- defer {
- file.close();
- tmp.dir.deleteFile(tmp_file_name) catch {};
- }
+ defer file.close();
+
const stat_old = try file.stat();
// Set atime and mtime to 5s before
try file.updateTimes(