add gcrc test2

This commit is contained in:
zhangbiao
2019-06-10 15:55:43 +08:00
parent 3a72686774
commit 6814372a89

View File

@ -9,6 +9,7 @@
package gcrc32_test
import (
"github.com/gogf/gf/g/crypto/gmd5"
"testing"
"github.com/gogf/gf/g/crypto/gcrc32"
@ -34,5 +35,10 @@ func TestEncrypt(t *testing.T) {
encrypt2 := gcrc32.Encrypt([]byte(s))
gtest.AssertEQ(int(encrypt1), result)
gtest.AssertEQ(int(encrypt2), result)
strmd5 := gmd5.Encrypt(s)
test1 := gcrc32.Encrypt(strmd5)
test2 := gcrc32.Encrypt([]byte(strmd5))
gtest.AssertEQ(test2, test1)
})
}