Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions tgz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ func TestExtractError(t *testing.T) {
}{
{
tgz: "not-found",
errRgx: regexp.MustCompile("open not-found: no such file .*"),
errRgx: regexp.MustCompile("open not-found: (no such file|The system cannot find the file) .*"),
}, {
tgz: "fixtures/invalid-gzip.tgz",
tgz: filepath.Join("fixtures", "invalid-gzip.tgz"),
errRgx: regexp.MustCompile("gzip: invalid header"),
}, {
tgz: "fixtures/not-a-tar.tgz",
tgz: filepath.Join("fixtures", "not-a-tar.tgz"),
errRgx: regexp.MustCompile("unexpected EOF"),
},
} {
Expand Down Expand Up @@ -53,29 +53,29 @@ func TestExtract(t *testing.T) {
tree []string
}{
{
tgz: "fixtures/test-01.tgz",
tgz: filepath.Join("fixtures", "test-01.tgz"),
tree: []string{
"foo.txt",
},
}, {
tgz: "fixtures/test-02.tgz",
tgz: filepath.Join("fixtures", "test-02.tgz"),
tree: []string{
"baz.txt",
"bla.txt",
"foo.txt",
},
}, {
tgz: "fixtures/test-03.tgz",
tgz: filepath.Join("fixtures", "test-03.tgz"),
tree: []string{
"bar",
"bar/baz.txt",
"bar/foo.txt",
filepath.Join("bar", "baz.txt"),
filepath.Join("bar", "foo.txt"),
"baz",
"baz/bar",
"baz/bar/foo.txt",
"baz/baz",
"baz/baz/baz",
"baz/baz/baz/foo.txt",
filepath.Join("baz", "bar"),
filepath.Join("baz", "bar", "foo.txt"),
filepath.Join("baz", "baz"),
filepath.Join("baz", "baz", "baz"),
filepath.Join("baz", "baz", "baz", "foo.txt"),
"foo.txt",
},
},
Expand All @@ -84,7 +84,7 @@ func TestExtract(t *testing.T) {

path, err := Extract(test.tgz)
if err != nil {
t.Fatalf("%s: unexpected error extracting: %s", err)
t.Fatalf("%s: unexpected error extracting: %s", com, err)
}

obt, err := relativeTree(path)
Expand Down