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

Function TestNotPanics

assert/assertions_test.go:1616–1631  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1614}
1615
1616func TestNotPanics(t *testing.T) {
1617 t.Parallel()
1618
1619 mockT := new(testing.T)
1620
1621 if !NotPanics(mockT, func() {
1622 }) {
1623 t.Error("NotPanics should return true")
1624 }
1625
1626 if NotPanics(mockT, func() {
1627 panic("Panic!")
1628 }) {
1629 t.Error("NotPanics should return false")
1630 }
1631}
1632
1633func TestNoError(t *testing.T) {
1634 t.Parallel()

Callers

nothing calls this directly

Calls 2

NotPanicsFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…