diff options
| author | xuri <xuri.me@gmail.com> | 2020-10-12 00:05:27 +0800 |
|---|---|---|
| committer | xuri <xuri.me@gmail.com> | 2020-10-12 00:05:27 +0800 |
| commit | ac3dce0beaef6cbf2b08db4a1e2b2a8d100c77ca (patch) | |
| tree | 6698f873e2e99666521c28eac470a4a89ee76836 /crypt_test.go | |
| parent | d1926675f81fcf9afb658e1e51cd4e43d0d05bc9 (diff) | |
- Resolve #711, update docs for the GetSheetIndex
- Update unit test
Diffstat (limited to 'crypt_test.go')
| -rw-r--r-- | crypt_test.go | 12 |
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))) +} |
