Panics asserts that the code inside the specified PanicTestFunc panics. assert.Panics(t, func(){ GoCrazy() })
(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{})
| 1740 | // |
| 1741 | // assert.Panics(t, func(){ GoCrazy() }) |
| 1742 | func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { |
| 1743 | if h, ok := t.(tHelper); ok { |
| 1744 | h.Helper() |
| 1745 | } |
| 1746 | if assert.Panics(t, f, msgAndArgs...) { |
| 1747 | return |
| 1748 | } |
| 1749 | t.FailNow() |
| 1750 | } |
| 1751 | |
| 1752 | // PanicsWithError asserts that the code inside the specified PanicTestFunc |
| 1753 | // panics, and that the recovered panic value is an error that satisfies the |
searching dependent graphs…