Skip to content

Commit

Permalink
More descriptive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstinnett committed Aug 30, 2023
1 parent aef73ff commit 369af42
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package archiver
import (
"bytes"
_ "embed"
"errors"
"fmt"
"io"
"io/fs"
Expand Down Expand Up @@ -59,11 +58,11 @@ func TestSelfTar(t *testing.T) {
fn := "testdata/self-tar.tar"
fh, err := os.Open(fn)
if err != nil {
t.Error("Could not load test tar")
t.Fatalf("Could not load test tar: %v", fn)
}
fstat, err := os.Stat(fn)
if err != nil {
t.Error("Could not stat test tar")
t.Fatalf("Could not stat test tar: %v", fn)
}
fsys := ArchiveFS{
Stream: io.NewSectionReader(fh, 0, fstat.Size()),
Expand All @@ -73,7 +72,7 @@ func TestSelfTar(t *testing.T) {
err = fs.WalkDir(fsys, ".", func(path string, d fs.DirEntry, err error) error {
if count > 10 {
t.Error("walking test tar appears to be recursing in error")
return errors.New("recursing tar")
return fmt.Errorf("recursing tar: %v", fn)
}
count++
return nil
Expand Down

0 comments on commit 369af42

Please sign in to comment.