Skip to content

Commit

Permalink
Mimic the behavior of archive/tar, which rounds timestamps to the nea…
Browse files Browse the repository at this point in the history
…rest second
  • Loading branch information
brandonc committed Oct 12, 2023
1 parent c42e18a commit 6e51f25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6e51f25

Please sign in to comment.