From 63adac25897f295ef4493e060d917650f03ebd3b Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 20 May 2022 20:46:29 +0800 Subject: make workbook open filed exception message clear - New exported constant `ErrWorkbookPassword` - Rename exported constant `ErrWorkbookExt` to `ErrWorkbookFileFormat` --- crypt_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crypt_test.go') 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()) -- cgit v1.2.1