add gcrc test

This commit is contained in:
zhangbiao
2019-06-10 15:05:11 +08:00
parent aa73c5ed53
commit 3a72686774

View File

@ -15,7 +15,7 @@ import (
"github.com/gogf/gf/g/test/gtest"
)
func TestEncrypt(t *testing.T) {
func TestEncryptString(t *testing.T) {
gtest.Case(t, func() {
s := "pibigstar"
result := 693191136
@ -25,3 +25,14 @@ func TestEncrypt(t *testing.T) {
gtest.AssertEQ(int(encrypt2), result)
})
}
func TestEncrypt(t *testing.T) {
gtest.Case(t, func() {
s := "pibigstar"
result := 693191136
encrypt1 := gcrc32.Encrypt(s)
encrypt2 := gcrc32.Encrypt([]byte(s))
gtest.AssertEQ(int(encrypt1), result)
gtest.AssertEQ(int(encrypt2), result)
})
}