mirror of https://github.com/stretchr/testify.git
Don't handle func comparisons
parent
842aeb8181
commit
4f9c9aeeaa
|
@ -36,10 +36,6 @@ func ObjectsAreEqual(expected, actual interface{}) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if reflect.ValueOf(expected) == reflect.ValueOf(actual) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
}
|
||||
|
|
|
@ -115,10 +115,6 @@ func TestEqual(t *testing.T) {
|
|||
if !Equal(mockT, uint64(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")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -406,19 +402,6 @@ func TestNotPanics(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
func TestEqual_Funcs(t *testing.T) {
|
||||
|
||||
type f func() int
|
||||
f1 := func() int { return 1 }
|
||||
f2 := func() int { return 2 }
|
||||
|
||||
f1Copy := f1
|
||||
|
||||
Equal(t, f1Copy, f1, "Funcs are the same and should be considered equal")
|
||||
NotEqual(t, f1, f2, "f1 and f2 are different")
|
||||
|
||||
}
|
||||
|
||||
func TestNoError(t *testing.T) {
|
||||
|
||||
mockT := new(testing.T)
|
||||
|
|
|
@ -259,21 +259,6 @@ func TestNotPanicsWrapper(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
func TestEqualWrapper_Funcs(t *testing.T) {
|
||||
|
||||
assert := New(t)
|
||||
|
||||
type f func() int
|
||||
var f1 f = func() int { return 1 }
|
||||
var f2 f = func() int { return 2 }
|
||||
|
||||
var f1_copy f = f1
|
||||
|
||||
assert.Equal(f1_copy, f1, "Funcs are the same and should be considered equal")
|
||||
assert.NotEqual(f1, f2, "f1 and f2 are different")
|
||||
|
||||
}
|
||||
|
||||
func TestNoErrorWrapper(t *testing.T) {
|
||||
assert := New(t)
|
||||
mockAssert := New(new(testing.T))
|
||||
|
|
Loading…
Reference in New Issue