summaryrefslogtreecommitdiff
path: root/crypt_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-10-12 00:05:27 +0800
committerxuri <xuri.me@gmail.com>2020-10-12 00:05:27 +0800
commitac3dce0beaef6cbf2b08db4a1e2b2a8d100c77ca (patch)
tree6698f873e2e99666521c28eac470a4a89ee76836 /crypt_test.go
parentd1926675f81fcf9afb658e1e51cd4e43d0d05bc9 (diff)
- Resolve #711, update docs for the GetSheetIndex
- Update unit test
Diffstat (limited to 'crypt_test.go')
-rw-r--r--crypt_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypt_test.go b/crypt_test.go
index f9a3fb7..6f712c1 100644
--- a/crypt_test.go
+++ b/crypt_test.go
@@ -21,3 +21,15 @@ func TestEncrypt(t *testing.T) {
assert.NoError(t, err)
assert.EqualError(t, f.SaveAs(filepath.Join("test", "BadEncrypt.xlsx"), Options{Password: "password"}), "not support encryption currently")
}
+
+func TestEncryptionMechanism(t *testing.T) {
+ mechanism, err := encryptionMechanism([]byte{3, 0, 3, 0})
+ assert.Equal(t, mechanism, "extensible")
+ assert.EqualError(t, err, "unsupport encryption mechanism")
+ _, err = encryptionMechanism([]byte{})
+ assert.EqualError(t, err, "unknown encryption mechanism")
+}
+
+func TestHashing(t *testing.T) {
+ assert.Equal(t, hashing("unsupportHashAlgorithm", []byte{}), []uint8([]byte(nil)))
+}