Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Aug 16, 2023
1 parent fed7684 commit a761c3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/tar/tar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ func TestWriter(t *testing.T) {
outPath := path.Join(tmpDir, "output.tar.gz")
file, err := os.Create(outPath)
g.Expect(err).To(gomega.BeNil())

// Write the ./data tree.
writer := tar.NewWriter(file)
err = writer.AddDir("./data", tar.Filter{})
g.Expect(err).To(gomega.BeNil())
g.Expect(err).To(gomega.BeNil())

// Write ./data/rabbit => data/pet/rabbit
err = writer.AddFile("./data/rabbit", "data/pet/rabbit")
g.Expect(err).To(gomega.BeNil())
writer.Close()
_ = file.Close()

// Read/expand the tarball.
reader := tar.NewReader()
file, err = os.Open(outPath)
Expand All @@ -57,6 +60,7 @@ func TestWriter(t *testing.T) {
return
})
g.Expect(err).To(gomega.BeNil())

// Validate ./data/pet/rabbit
_ = assert.EqualFileContent("./data/rabbit", path.Join(tmpDir, "data", "pet", "rabbit"))
}

0 comments on commit a761c3b

Please sign in to comment.