PanicsWithErrorf asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value is an error that satisfies the EqualError comparison. require.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
(t TestingT, errString string, f assert.PanicTestFunc, msg string, args ...interface{})
| 1881 | // |
| 1882 | // require.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") |
| 1883 | func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg string, args ...interface{}) { |
| 1884 | if h, ok := t.(tHelper); ok { |
| 1885 | h.Helper() |
| 1886 | } |
| 1887 | if assert.PanicsWithErrorf(t, errString, f, msg, args...) { |
| 1888 | return |
| 1889 | } |
| 1890 | t.FailNow() |
| 1891 | } |
| 1892 | |
| 1893 | // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that |
| 1894 | // the recovered panic value equals the expected panic value. |
no test coverage detected