PanicsWithError asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the EqualError comparison. require.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{})
| 1866 | // |
| 1867 | // require.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) |
| 1868 | func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) { |
| 1869 | if h, ok := t.(tHelper); ok { |
| 1870 | h.Helper() |
| 1871 | } |
| 1872 | if assert.PanicsWithError(t, errString, f, msgAndArgs...) { |
| 1873 | return |
| 1874 | } |
| 1875 | t.FailNow() |
| 1876 | } |
| 1877 | |
| 1878 | // PanicsWithErrorf asserts that the code inside the specified PanicTestFunc |
| 1879 | // panics, and that the recovered panic value is an error that satisfies the |
no test coverage detected