mirror of https://github.com/stretchr/testify.git
parent
b09b5a43a5
commit
ed4976c764
|
@ -60,16 +60,6 @@ func ObjectsAreEqual(expected, actual interface{}) bool {
|
|||
return expected == actual
|
||||
}
|
||||
|
||||
tExp, ok := expected.(time.Time)
|
||||
if ok {
|
||||
|
||||
tAct, ok := actual.(time.Time)
|
||||
if ok {
|
||||
return tExp.Equal(tAct)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
exp, ok := expected.([]byte)
|
||||
if !ok {
|
||||
return reflect.DeepEqual(expected, actual)
|
||||
|
|
|
@ -148,21 +148,6 @@ func TestObjectsAreEqual(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
func TestObjectsAreEqual_SerializedTime(t *testing.T) {
|
||||
t0 := time.Now().Round(0)
|
||||
b, err := json.Marshal(t0)
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
var t1 time.Time
|
||||
if err := json.Unmarshal(b, &t1); err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
if !ObjectsAreEqual(t0, t1) {
|
||||
t.Errorf("time must be equals")
|
||||
}
|
||||
}
|
||||
|
||||
func TestImplements(t *testing.T) {
|
||||
|
||||
mockT := new(testing.T)
|
||||
|
|
Loading…
Reference in New Issue