Skip to content

Commit

Permalink
Use deep equal after conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Meyer committed Nov 30, 2014
1 parent 88bce07 commit 807610f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: go

go:
- 1.0
- 1.1
- 1.2
- 1.3
- tip

script:
- go test -v ./...

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Testify - Thou Shalt Write Tests
================================

[![Build Status](https://travis-ci.org/raphaelmeyer/testify.png)](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:
Expand Down
3 changes: 1 addition & 2 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 807610f

Please sign in to comment.