MCPcopy Create free account
hub / github.com/buger/jsonparser / recoverNoPanic

Function recoverNoPanic

property_test.go:141–149  ·  view source on GitHub ↗

recoverNoPanic runs fn and reports whether it returned without panicking.

(fn func())

Source from the content-addressed store, hash-verified

139
140// recoverNoPanic runs fn and reports whether it returned without panicking.
141func recoverNoPanic(fn func()) (ok bool) {
142 defer func() {
143 if r := recover(); r != nil {
144 ok = false
145 }
146 }()
147 fn()
148 return true
149}
150
151func assertInputUnchanged(t *testing.T, data []byte, fn func()) {
152 t.Helper()

Calls

no outgoing calls

Tested by

no test coverage detected