diff options
author | xuri <xuri.me@gmail.com> | 2019-06-27 21:58:14 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-06-27 21:58:14 +0800 |
commit | 54def7eaad9ee0469ca495b3661798919239384a (patch) | |
tree | 4f99eeb2e929c9baa037f31574f7b45cd3d11b81 /excelize_test.go | |
parent | 9f8623047d2fc38e12c3b214475710d25ec88c55 (diff) |
Add TIF, TIFF format images and more detailed error information when open the encrypted file
Diffstat (limited to 'excelize_test.go')
-rw-r--r-- | excelize_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/excelize_test.go b/excelize_test.go index c7c3aec..c4a06a5 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -1,6 +1,7 @@ package excelize import ( + "bytes" "fmt" "image/color" _ "image/gif" @@ -185,6 +186,14 @@ func TestSaveAsWrongPath(t *testing.T) { func TestOpenReader(t *testing.T) { _, err := OpenReader(strings.NewReader("")) assert.EqualError(t, err, "zip: not a valid zip file") + _, err = OpenReader(bytes.NewReader([]byte{ + 0x3c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x69, 0x00, 0x63, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x73, 0x00, + 0x6f, 0x00, 0x66, 0x00, 0x74, 0x00, 0x2e, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00, + 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x72, 0x00, 0x2e, 0x00, 0x44, 0x00, 0x61, 0x00, + 0x74, 0x00, 0x61, 0x00, 0x53, 0x00, 0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x73, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + })) + assert.EqualError(t, err, "not support encrypted file currently") } func TestBrokenFile(t *testing.T) { |