github.com/sereiner/library@v0.0.0-20200518095232-1fa3e640cc5f/security/sha1/sha1_test.go (about) 1 package sha1 2 3 import ( 4 "strings" 5 "testing" 6 ) 7 8 func TestEncrypt(t *testing.T) { 9 input := "hello" 10 except := "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d" 11 // except := "AAF4C61DDCC5E8A2DABEDE0F3B482CD9AEA9434D" 12 actual := Encrypt(input) 13 if !strings.EqualFold(actual, except) { 14 t.Errorf("Encrypt fail %s to %s", except, actual) 15 } 16 }