authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-15 08:18:54+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-01-21 16:41:30+01:00
logfc59f0e7f0681096cf99fbd27330ed7c5ba5ffaa
tree2b3ecb03ba61565bab1783b04fed47300174f8b1
parent2207c62bb5f6d61fc9f430e849d0aed13cf63d35
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Io.test: skip atime check in `setTimestamps` on NetBSD


1 files changed, 4 insertions(+), 1 deletions(-)

lib/std/Io/test.zig+4-1
...@@ -181,7 +181,10 @@ test "setTimestamps" {...@@ -181,7 +181,10 @@ test "setTimestamps" {
181 .modify_timestamp = .{ .new = stat_old.mtime.subDuration(.fromSeconds(5)) },181 .modify_timestamp = .{ .new = stat_old.mtime.subDuration(.fromSeconds(5)) },
182 });182 });
183 const stat_new = try file.stat(io);183 const stat_new = try file.stat(io);
184 if (stat_old.atime) |old_atime| try expect(stat_new.atime.?.nanoseconds < old_atime.nanoseconds);184 // NetBSD with noatime will just not update the timestamp, and noatime is default in at least NetBSD 11+.
185 if (builtin.os.tag != .netbsd) {
186 if (stat_old.atime) |old_atime| try expect(stat_new.atime.?.nanoseconds < old_atime.nanoseconds);
187 }
185 try expect(stat_new.mtime.nanoseconds < stat_old.mtime.nanoseconds);188 try expect(stat_new.mtime.nanoseconds < stat_old.mtime.nanoseconds);
186}189}
187190