mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 21:52:28 +03:00
20 lines
394 B
Go
20 lines
394 B
Go
|
package checksum_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
|
||
|
"github.com/neilotoole/sq/libsq/core/ioz/checksum"
|
||
|
)
|
||
|
|
||
|
func TestSum(t *testing.T) {
|
||
|
got := checksum.Sum(nil)
|
||
|
require.Equal(t, "", got)
|
||
|
got = checksum.Sum([]byte{})
|
||
|
require.Equal(t, "", got)
|
||
|
got = checksum.Sum([]byte("hello world"))
|
||
|
assert.Equal(t, "d4a1185", got)
|
||
|
}
|