fix bug in tests
This commit is contained in:
parent
9e1d2601ac
commit
c8907a411e
@ -74,7 +74,7 @@ func (tb tarball) bytes(t *testing.T) []byte {
|
|||||||
|
|
||||||
func extract(t *testing.T, tarball io.Reader) []file {
|
func extract(t *testing.T, tarball io.Reader) []file {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
var ret []file
|
ret := []file{}
|
||||||
tr := tar.NewReader(tarball)
|
tr := tar.NewReader(tarball)
|
||||||
for {
|
for {
|
||||||
hdr, err := tr.Next()
|
hdr, err := tr.Next()
|
||||||
@ -89,6 +89,7 @@ func extract(t *testing.T, tarball io.Reader) []file {
|
|||||||
io.Copy(&buf, tr)
|
io.Copy(&buf, tr)
|
||||||
elem.contents = buf.Bytes()
|
elem.contents = buf.Bytes()
|
||||||
}
|
}
|
||||||
|
ret = append(ret, elem)
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user