github.com/sereiner/library@v0.0.0-20200518095232-1fa3e640cc5f/security/md5/md5_test.go (about) 1 package md5 2 3 import ( 4 "strings" 5 "testing" 6 ) 7 8 func TestEncrypt(t *testing.T) { 9 input := "md5str" 10 except := "7A3F2CFF1CD6BA4B6A23B7BFAD65719D" 11 actual := Encrypt(input) 12 if !strings.EqualFold(strings.ToLower(actual), strings.ToLower(except)) { 13 t.Errorf("测试失败%s\t%s", strings.ToLower(actual), strings.ToLower(except)) 14 } 15 }