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

Function TestNotPanics

require/requirements_test.go:193–205  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func TestNotPanics(t *testing.T) {
194 t.Parallel()
195
196 NotPanics(t, func() {})
197
198 mockT := new(MockT)
199 NotPanics(mockT, func() {
200 panic("Panic!")
201 })
202 if !mockT.Failed {
203 t.Error("Check should fail")
204 }
205}
206
207func TestNoError(t *testing.T) {
208 t.Parallel()

Callers

nothing calls this directly

Calls 2

NotPanicsFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected