Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Aug 13, 2023
1 parent 9d0fc63 commit f1c87f2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tar/tar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"strings"
"testing"
"time"

"github.com/essentialkaos/ek/v12/fsutil"
"github.com/essentialkaos/ek/v12/hash"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f1c87f2

Please sign in to comment.