summaryrefslogtreecommitdiff
path: root/crypt_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-05-20 20:46:29 +0800
committerxuri <xuri.me@gmail.com>2022-05-20 20:46:29 +0800
commit63adac25897f295ef4493e060d917650f03ebd3b (patch)
tree5153f2be474304832fe4420905a922013bb2088f /crypt_test.go
parent8f16a76781fb8f47094492c38a02c2cdc4ce5013 (diff)
make workbook open filed exception message clear
- New exported constant `ErrWorkbookPassword` - Rename exported constant `ErrWorkbookExt` to `ErrWorkbookFileFormat`
Diffstat (limited to 'crypt_test.go')
-rw-r--r--crypt_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypt_test.go b/crypt_test.go
index 80f6cc4..d095176 100644
--- a/crypt_test.go
+++ b/crypt_test.go
@@ -19,6 +19,9 @@ import (
)
func TestEncrypt(t *testing.T) {
+ _, err := OpenFile(filepath.Join("test", "encryptSHA1.xlsx"), Options{Password: "passwd"})
+ assert.EqualError(t, err, ErrWorkbookPassword.Error())
+
f, err := OpenFile(filepath.Join("test", "encryptSHA1.xlsx"), Options{Password: "password"})
assert.NoError(t, err)
assert.EqualError(t, f.SaveAs(filepath.Join("test", "BadEncrypt.xlsx"), Options{Password: "password"}), ErrEncrypt.Error())