From 6e51f254e56ad454880c3058cb23983be29e6f31 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 12 Oct 2023 16:02:34 -0600 Subject: [PATCH] Mimic the behavior of archive/tar, which rounds timestamps to the nearest second --- slug_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slug_test.go b/slug_test.go index 6128990..1c7cf5c 100644 --- a/slug_test.go +++ b/slug_test.go @@ -1256,8 +1256,8 @@ func verifyTimestamps(t *testing.T, src, dst string) { t.Fatalf("dst file %q not found", dst) } - sourceModTime := sourceInfo.ModTime().Truncate(time.Second) - destModTime := dstInfo.ModTime().Truncate(time.Second) + sourceModTime := sourceInfo.ModTime().Round(time.Second) + destModTime := dstInfo.ModTime().Round(time.Second) if !sourceModTime.Equal(destModTime) { t.Fatalf("source %q and dst %q do not have the same mtime (%q and %q, respectively)", src, dst, sourceModTime, destModTime)