summaryrefslogtreecommitdiff
path: root/src/pkg/archive/tar/tar_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/archive/tar/tar_test.go')
-rw-r--r--src/pkg/archive/tar/tar_test.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pkg/archive/tar/tar_test.go b/src/pkg/archive/tar/tar_test.go
index dd6310313..616a9cc57 100644
--- a/src/pkg/archive/tar/tar_test.go
+++ b/src/pkg/archive/tar/tar_test.go
@@ -8,7 +8,9 @@ import (
"bytes"
"io/ioutil"
"os"
+ "path"
"reflect"
+ "strings"
"testing"
"time"
)
@@ -249,7 +251,14 @@ func TestHeaderRoundTrip(t *testing.T) {
t.Error(err)
continue
}
- if got, want := h2.Name, g.h.Name; got != want {
+ if strings.Contains(fi.Name(), "/") {
+ t.Errorf("FileInfo of %q contains slash: %q", g.h.Name, fi.Name())
+ }
+ name := path.Base(g.h.Name)
+ if fi.IsDir() {
+ name += "/"
+ }
+ if got, want := h2.Name, name; got != want {
t.Errorf("i=%d: Name: got %v, want %v", i, got, want)
}
if got, want := h2.Size, g.h.Size; got != want {