diff --git a/assert/assertions_test.go b/assert/assertions_test.go index d859c77..15117d2 100644 --- a/assert/assertions_test.go +++ b/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 testAutogeneratedFucntion() { + 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() { + testAutogeneratedFucntion() + }) +}