You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
440 B
33 lines
440 B
5 years ago
|
package hashid
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestHashEncode(t *testing.T) {
|
||
|
asserts := assert.New(t)
|
||
|
|
||
|
{
|
||
|
res, err := HashEncode([]int{1, 2, 3})
|
||
|
asserts.NoError(err)
|
||
|
asserts.NotEmpty(res)
|
||
|
}
|
||
|
|
||
|
{
|
||
|
res, err := HashEncode([]int{})
|
||
|
asserts.Error(err)
|
||
|
asserts.Empty(res)
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
func TestHashID(t *testing.T) {
|
||
|
asserts := assert.New(t)
|
||
|
|
||
|
{
|
||
|
res := HashID(1, ShareID)
|
||
|
asserts.NotEmpty(res)
|
||
|
}
|
||
|
}
|