From 7a9121a16201701ce13686bf63fa72d2f647614f Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 17 Dec 2014 16:41:45 +0100 Subject: [PATCH] added tests from PR #103 --- assert/assertions_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assert/assertions_test.go b/assert/assertions_test.go index bb63be2..70cedaf 100644 --- a/assert/assertions_test.go +++ b/assert/assertions_test.go @@ -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")