From ac3dce0beaef6cbf2b08db4a1e2b2a8d100c77ca Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 12 Oct 2020 00:05:27 +0800 Subject: - Resolve #711, update docs for the GetSheetIndex - Update unit test --- crypt_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crypt_test.go') 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))) +} -- cgit v1.2.1