PanicsWithError asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the EqualError comparison. assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{})
| 1755 | // |
| 1756 | // assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) |
| 1757 | func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) { |
| 1758 | if h, ok := t.(tHelper); ok { |
| 1759 | h.Helper() |
| 1760 | } |
| 1761 | if assert.PanicsWithError(t, errString, f, msgAndArgs...) { |
| 1762 | return |
| 1763 | } |
| 1764 | t.FailNow() |
| 1765 | } |
| 1766 | |
| 1767 | // PanicsWithErrorf asserts that the code inside the specified PanicTestFunc |
| 1768 | // panics, and that the recovered panic value is an error that satisfies the |
no test coverage detected
searching dependent graphs…