From 807610fbf10d071d8e04d67092bd002b8c75aec3 Mon Sep 17 00:00:00 2001 From: Raphael Meyer Date: Sun, 30 Nov 2014 09:22:56 +0100 Subject: [PATCH] Use deep equal after conversion. --- .travis.yml | 12 ++++++++++++ README.md | 2 ++ assert/assertions.go | 3 +-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8e0ad203b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: go + +go: + - 1.0 + - 1.1 + - 1.2 + - 1.3 + - tip + +script: + - go test -v ./... + diff --git a/README.md b/README.md index 59db22a62..d54a8e68a 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/assert/assertions.go b/assert/assertions.go index 95c442018..cdcff8433 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -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 } }