blob: 47763230029a731b11115e5a234bf0e81f8b4a70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package main
import (
"testing"
)
func TestMd5Hash(t *testing.T) {
hash := "f9d08276bc85d30d578e8883f3c7e843"
testHash := Md5Hash("md5hash")
if hash != testHash {
t.Fatal("Expected %s as hash. Got %s.", hash, testHash)
}
}
func TestCompareStrings(t *testing.T) {
if !CompareStrings("foo", "foo", "foo") {
t.Fatal("All strings are equal. Expected true.")
}
if CompareStrings("bar", "foo", "hello world", "523") {
t.Fatal("Strings are not equal. Exptected false")
}
}
|