MCPcopy
hub / github.com/stretchr/testify / Panic

Method Panic

mock/mock.go:120–127  ·  view source on GitHub ↗

Panic specifies if the function call should fail and the panic message Mock.On("DoSomething").Panic("test panic")

(msg string)

Source from the content-addressed store, hash-verified

118//
119// Mock.On("DoSomething").Panic("test panic")
120func (c *Call) Panic(msg string) *Call {
121 c.lock()
122 defer c.unlock()
123
124 c.PanicMsg = &msg
125
126 return c
127}
128
129// Once indicates that the mock should only return the value once.
130//

Callers 2

Test_Mock_PanicFunction · 0.80

Calls 2

lockMethod · 0.95
unlockMethod · 0.95

Tested by 2

Test_Mock_PanicFunction · 0.64