MCPcopy Create free account
hub / github.com/stretchr/testify / PanicsWithValue

Method PanicsWithValue

assert/assertion_forward.go:1461–1466  ·  view source on GitHub ↗

PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that the recovered panic value equals the expected panic value. a.PanicsWithValue("crazy error", func(){ GoCrazy() })

(expected interface{}, f PanicTestFunc, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1459//
1460// a.PanicsWithValue("crazy error", func(){ GoCrazy() })
1461func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool {
1462 if h, ok := a.t.(tHelper); ok {
1463 h.Helper()
1464 }
1465 return PanicsWithValue(a.t, expected, f, msgAndArgs...)
1466}
1467
1468// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
1469// the recovered panic value equals the expected panic value.

Callers

nothing calls this directly

Calls 2

PanicsWithValueFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected