From f1c87f2c000193c4b0d8fa684d8c3a39131e0c91 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sun, 13 Aug 2023 23:50:30 +0300 Subject: [PATCH] Improve tests --- tar/tar_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tar/tar_test.go b/tar/tar_test.go index b8d5504..93be7ab 100644 --- a/tar/tar_test.go +++ b/tar/tar_test.go @@ -12,6 +12,7 @@ import ( "os" "strings" "testing" + "time" "github.com/essentialkaos/ek/v12/fsutil" "github.com/essentialkaos/ek/v12/hash" @@ -89,11 +90,19 @@ func (s *TarSuite) TestErrors(c *C) { c.Assert(err, NotNil) UpdateTimes, UpdateOwner = true, false - err = updateAttrs(&tar.Header{Linkname: "/__unknown"}, "/_unknown") + err = updateAttrs(&tar.Header{ + Linkname: "/__unknown", + AccessTime: time.Now(), + ModTime: time.Now(), + }, "/_unknown") c.Assert(err, NotNil) UpdateTimes, UpdateOwner = false, true - err = updateAttrs(&tar.Header{Linkname: "/__unknown"}, "/_unknown") + err = updateAttrs(&tar.Header{ + Linkname: "/__unknown", + AccessTime: time.Now(), + ModTime: time.Now(), + }, "/_unknown") c.Assert(err, NotNil) UpdateTimes, UpdateOwner = true, false