mirror of
https://github.com/gofiber/storage.git
synced 2025-10-03 07:46:42 +08:00
Fix incorrect sum.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/sha256"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -12,9 +13,12 @@ func Test_S3_SetWithChecksum(t *testing.T) {
|
||||
key = "john"
|
||||
val = []byte("doe")
|
||||
sha256sum = sha256.New().Sum(val)
|
||||
checksum = map[types.ChecksumAlgorithm][]byte{
|
||||
types.ChecksumAlgorithmSha256: sha256sum,
|
||||
}
|
||||
)
|
||||
|
||||
err := testStore.SetWithChecksum(key, val, map[string][]byte{"SHA256": sha256sum})
|
||||
err := testStore.SetWithChecksum(key, val, checksum)
|
||||
require.NoError(t, err)
|
||||
|
||||
result, err := testStore.Get(key)
|
||||
|
Reference in New Issue
Block a user