summaryrefslogtreecommitdiff
path: root/utilities_test.go
blob: 61d0b274ccc5eb39c2ccdbc26cba1a105ead49df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// +build all general

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")
	}
}