goProject/trunk/goutil/stringUtil/hash_test.go

24 lines
369 B
Go
Raw Normal View History

2025-01-06 16:01:02 +08:00
package stringUtil
import (
"testing"
)
func Test1(t *testing.T) {
s := HashCode("abc")
s1 := HashCode("abc")
if s != s1 {
t.Errorf("s1 hashcode:%v,s2 hashcode:%v,2个code值不相等", s, s1)
}
}
func Test2(t *testing.T) {
s := HashCode("abc")
s1 := HashCode("bcd")
if s == s1 {
t.Errorf("s1 hashcode:%v,s2 hashcode:%v,2个code值相等", s, s1)
}
}