summaryrefslogtreecommitdiff
path: root/crypt_test.go
diff options
context:
space:
mode:
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())