Add test to avoid regression of issue #180

pull/89/merge
Ernesto Jiménez 2015-06-14 19:29:18 +01:00
parent c769e40e8b
commit abc938a12b
1 changed files with 22 additions and 0 deletions

View File

@ -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()
})
}