diff --git a/cmd/cli/pzip_test.go b/cmd/cli/pzip_test.go index c8f8a32..0d4262d 100644 --- a/cmd/cli/pzip_test.go +++ b/cmd/cli/pzip_test.go @@ -1,7 +1,6 @@ package main_test import ( - "log" "path/filepath" "testing" @@ -16,27 +15,28 @@ const ( ) func TestPzip(t *testing.T) { - if testing.Short() { - t.Skip() - } - binPath, cleanup, err := cli.BuildBinary() if err != nil { - log.Fatal("ERROR: could not build binary", err) - } - defer cleanup() - - absArchivePath, err := filepath.Abs(archivePath) - if err != nil { - t.Fatalf("ERROR: could not get path to archive %s", archivePath) + t.Fatal("ERROR: could not build binary", err) } - - absDirPath, err := filepath.Abs(dirPath) - if err != nil { - t.Fatalf("ERROR: could not get path to directory %s", dirPath) - } - - driver := cli.NewDriver(binPath, absArchivePath, absDirPath) - - specifications.ArchiveDir(t, driver) + t.Cleanup(cleanup) + t.Run("archives directory", func(t *testing.T) { + if testing.Short() { + t.Skip() + } + + absArchivePath, err := filepath.Abs(archivePath) + if err != nil { + t.Fatalf("ERROR: could not get path to archive %s", archivePath) + } + + absDirPath, err := filepath.Abs(dirPath) + if err != nil { + t.Fatalf("ERROR: could not get path to directory %s", dirPath) + } + + driver := cli.NewDriver(binPath, absArchivePath, absDirPath) + + specifications.ArchiveDir(t, driver) + }) }