diff options
author | xuri <xuri.me@gmail.com> | 2020-05-23 13:29:51 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-05-23 13:29:51 +0800 |
commit | 7f78464f7f6ecd87c5f5c53d7c00320fd53c4a03 (patch) | |
tree | 0a1de4ead6b9f87af41932ab64fdd8147cc36cf9 /excelize_test.go | |
parent | 82bb1153d7b7ff1c50725bf34bd3cbc75b228137 (diff) |
add test for ReadZipReader, close #642
Diffstat (limited to 'excelize_test.go')
-rw-r--r-- | excelize_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/excelize_test.go b/excelize_test.go index 8ee8051..f839136 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -220,6 +220,22 @@ func TestOpenReader(t *testing.T) { _, err = OpenReader(r) assert.EqualError(t, err, "unexpected EOF") + + _, err = OpenReader(bytes.NewReader([]byte{ + 0x50, 0x4b, 0x03, 0x04, 0x0a, 0x00, 0x09, 0x00, 0x63, 0x00, 0x47, 0xa3, 0xb6, 0x50, 0x00, 0x00, + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x01, 0x99, 0x07, 0x00, 0x02, 0x00, 0x41, 0x45, 0x03, 0x00, + 0x00, 0x21, 0x06, 0x59, 0xc0, 0x12, 0xf3, 0x19, 0xc7, 0x51, 0xd1, 0xc9, 0x31, 0xcb, 0xcc, 0x8a, + 0xe1, 0x44, 0xe1, 0x56, 0x20, 0x24, 0x1f, 0xba, 0x09, 0xda, 0x53, 0xd5, 0xef, 0x50, 0x4b, 0x07, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b, 0x01, + 0x02, 0x1f, 0x00, 0x0a, 0x00, 0x09, 0x00, 0x63, 0x00, 0x47, 0xa3, 0xb6, 0x50, 0x00, 0x00, 0x00, + 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x01, 0x99, 0x07, 0x00, 0x02, 0x00, 0x41, 0x45, 0x03, 0x00, 0x00, 0x50, 0x4b, + 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x41, 0x00, 0x00, 0x00, 0x5d, 0x00, + 0x00, 0x00, 0x00, 0x00, + })) + assert.EqualError(t, err, "zip: unsupported compression algorithm") } func TestBrokenFile(t *testing.T) { |