Add Equal test comparing nil with non-nil

pull/392/head
Ernesto Jiménez 2017-01-30 11:25:29 +00:00
parent 2402e8e7a0
commit 332ae0e18f
1 changed files with 6 additions and 2 deletions

View File

@ -199,6 +199,10 @@ func TestEqual(t *testing.T) {
if !Equal(mockT, &struct{}{}, &struct{}{}) {
t.Error("Equal should return true (pointer equality is based on equality of underlying value)")
}
var m map[string]interface{}
if Equal(mockT, m["bar"], "something") {
t.Error("Equal should return false")
}
}
// bufferT implements TestingT. Its implementation of Errorf writes the output that would be produced by