mirror of https://github.com/stretchr/testify.git
Use deep equal after conversion.
parent
88bce07c05
commit
807610fbf1
|
@ -0,0 +1,12 @@
|
|||
language: go
|
||||
|
||||
go:
|
||||
- 1.0
|
||||
- 1.1
|
||||
- 1.2
|
||||
- 1.3
|
||||
- tip
|
||||
|
||||
script:
|
||||
- go test -v ./...
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
Testify - Thou Shalt Write Tests
|
||||
================================
|
||||
|
||||
[](https://travis-ci.org/raphaelmeyer/testify)
|
||||
|
||||
Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend.
|
||||
|
||||
Features include:
|
||||
|
|
|
@ -39,9 +39,8 @@ func ObjectsAreEqual(expected, actual interface{}) bool {
|
|||
actualType := reflect.TypeOf(actual)
|
||||
expectedType := reflect.TypeOf(expected)
|
||||
if actualType.ConvertibleTo(expectedType) {
|
||||
expectedValue := reflect.ValueOf(expected)
|
||||
actualValue := reflect.ValueOf(actual).Convert(expectedType)
|
||||
if actualValue == expectedValue {
|
||||
if reflect.DeepEqual(actualValue.Interface(), expected) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue