mirror of https://github.com/stretchr/testify.git
Add test to avoid regression of issue #180
parent
c769e40e8b
commit
abc938a12b
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue