Panicsf asserts that the code inside the specified PanicTestFunc panics. assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{})
| 1811 | // |
| 1812 | // assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") |
| 1813 | func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { |
| 1814 | if h, ok := t.(tHelper); ok { |
| 1815 | h.Helper() |
| 1816 | } |
| 1817 | if assert.Panicsf(t, f, msg, args...) { |
| 1818 | return |
| 1819 | } |
| 1820 | t.FailNow() |
| 1821 | } |
| 1822 | |
| 1823 | // Positive asserts that the specified element is positive |
| 1824 | // |