diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index ce35855f176b7..6898d12e09b7f 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -496,15 +496,15 @@ }, { "ImportPath": "github.com/stretchr/testify/assert", - "Rev": "7e4a149930b09fe4c2b134c50ce637457ba6e966" + "Rev": "089c7181b8c728499929ff09b62d3fdd8df8adff" }, { "ImportPath": "github.com/stretchr/testify/mock", - "Rev": "7e4a149930b09fe4c2b134c50ce637457ba6e966" + "Rev": "089c7181b8c728499929ff09b62d3fdd8df8adff" }, { "ImportPath": "github.com/stretchr/testify/require", - "Rev": "7e4a149930b09fe4c2b134c50ce637457ba6e966" + "Rev": "089c7181b8c728499929ff09b62d3fdd8df8adff" }, { "ImportPath": "github.com/syndtr/gocapability/capability", diff --git a/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go b/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go index 7b5ce7257e03e..fbf03f4d82ff9 100644 --- a/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go +++ b/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions.go @@ -84,6 +84,11 @@ func CallerInfo() []string { return nil } + // This is a huge edge case, but it will panic if this is the case, see #180 + if file == "" { + break + } + parts := strings.Split(file, "/") dir := parts[len(parts)-2] file = parts[len(parts)-1] @@ -296,7 +301,7 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { } if !success { - Fail(t, "Expected not to be nil.", msgAndArgs...) + Fail(t, "Expected value not to be nil.", msgAndArgs...) } return success diff --git a/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions_test.go b/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions_test.go index d859c77b91234..36c671eefef87 100644 --- a/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions_test.go +++ b/Godeps/_workspace/src/github.com/stretchr/testify/assert/assertions_test.go @@ -2,6 +2,7 @@ package assert import ( "errors" + "io" "math" "regexp" "testing" @@ -789,3 +790,24 @@ func TestRegexp(t *testing.T) { True(t, NotRegexp(mockT, regexp.MustCompile(tc.rx), tc.str)) } } + +func testAutogeneratedFunction() { + defer func() { + if err := recover(); err == nil { + panic("did not panic") + } + CallerInfo() + }() + t := struct { + io.Closer + }{} + var c io.Closer + c = t + c.Close() +} + +func TestCallerInfoWithAutogeneratedFunctions(t *testing.T) { + NotPanics(t, func() { + testAutogeneratedFunction() + }) +}