diff --git a/src/pkg/archive/zip/reader_test.go b/src/pkg/archive/zip/reader_test.go index 4292a50e30..971fbedb5c 100644 --- a/src/pkg/archive/zip/reader_test.go +++ b/src/pkg/archive/zip/reader_test.go @@ -355,8 +355,6 @@ func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) { testFileMode(t, zt.Name, f, ft.Mode) - size0 := f.UncompressedSize - var b bytes.Buffer r, err := f.Open() if err != nil { @@ -364,10 +362,6 @@ func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) { return } - if size1 := f.UncompressedSize; size0 != size1 { - t.Errorf("file %q changed f.UncompressedSize from %d to %d", f.Name, size0, size1) - } - _, err = io.Copy(&b, r) if err != ft.ContentErr { t.Errorf("%s: copying contents: %v (want %v)", zt.Name, err, ft.ContentErr) @@ -377,6 +371,14 @@ func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) { } r.Close() + size := int(f.UncompressedSize) + if size == 1<<32-1 { + size = int(f.UncompressedSize64) + } + if g := b.Len(); g != size { + t.Errorf("%v: read %v bytes but f.UncompressedSize == %v", f.Name, g, size) + } + var c []byte if ft.Content != nil { c = ft.Content