added tests from PR #103

pull/110/head
Henry 2014-12-17 16:41:45 +01:00
parent ae37dedcaa
commit 7a9121a162
1 changed files with 12 additions and 0 deletions

View File

@ -40,6 +40,9 @@ func TestObjectsAreEqual(t *testing.T) {
if !ObjectsAreEqual(nil, nil) {
t.Error("objectsAreEqual should return true")
}
if ObjectsAreEqual(map[int]int{5: 10}, map[int]int{10: 20}) {
t.Error("objectsAreEqual should return false")
}
}
@ -94,6 +97,10 @@ func TestEqual(t *testing.T) {
if !Equal(mockT, int64(123), uint64(123)) {
t.Error("Equal should return true")
}
funcA := func() int { return 42 }
if !Equal(mockT, funcA, funcA) {
t.Error("Equal should return true")
}
}
@ -196,6 +203,11 @@ func TestNotEqual(t *testing.T) {
if !NotEqual(mockT, nil, new(AssertionTesterConformingObject)) {
t.Error("NotEqual should return true")
}
funcA := func() int { return 23 }
funcB := func() int { return 42 }
if !NotEqual(mockT, funcA, funcB) {
t.Error("NotEqual should return true")
}
if NotEqual(mockT, "Hello World", "Hello World") {
t.Error("NotEqual should return false")