aboutsummaryrefslogtreecommitdiff
path: root/src/archive/zip/zip_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive/zip/zip_test.go')
-rw-r--r--src/archive/zip/zip_test.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index 8801e90413..57edb2cabf 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -15,7 +15,6 @@ import (
"internal/testenv"
"io"
"io/ioutil"
- "reflect"
"sort"
"strings"
"testing"
@@ -114,44 +113,6 @@ func TestFileHeaderRoundTrip64(t *testing.T) {
testHeaderRoundTrip(fh, uint32max, fh.UncompressedSize64, t)
}
-func TestZeroFileRoundTrip(t *testing.T) {
- var b bytes.Buffer
- w := NewWriter(&b)
- if _, err := w.Create(""); err != nil {
- t.Fatal(err)
- }
- if err := w.Close(); err != nil {
- t.Fatal(err)
- }
- r, err := NewReader(bytes.NewReader(b.Bytes()), int64(b.Len()))
- if err != nil {
- t.Fatal(err)
- }
-
- // Verify that fields that should reasonably be the zero value stays
- // as the zero value.
- var want FileHeader
- if len(r.File) != 1 {
- t.Fatalf("len(r.File) = %d, want 1", len(r.File))
- }
- fh := r.File[0].FileHeader
- got := FileHeader{
- Name: fh.Name,
- ModifiedTime: fh.ModifiedTime,
- ModifiedDate: fh.ModifiedDate,
- UncompressedSize: fh.UncompressedSize,
- UncompressedSize64: fh.UncompressedSize64,
- ExternalAttrs: fh.ExternalAttrs,
- Comment: fh.Comment,
- }
- if len(fh.Extra) > 0 {
- got.Extra = fh.Extra
- }
- if !reflect.DeepEqual(got, want) {
- t.Errorf("FileHeader mismatch:\ngot %#v\nwant %#v", got, want)
- }
-}
-
type repeatedByte struct {
off int64
b byte