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

Function assertAfterStep

path_fuzz_test.go:522–535  ·  view source on GitHub ↗

assertAfterStep runs the post-step invariants: no panic (caught above), json.Valid (when input was valid + shape matches), and the per-step sequence assertion (passed in as `check`).

(t *testing.T, label string, state []byte, path []string, check func(t *testing.T, state []byte))

Source from the content-addressed store, hash-verified

520// json.Valid (when input was valid + shape matches), and the per-step
521// sequence assertion (passed in as `check`).
522func assertAfterStep(t *testing.T, label string, state []byte, path []string, check func(t *testing.T, state []byte)) {
523 t.Helper()
524 if len(state) == 0 {
525 return
526 }
527 if !json.Valid(state) {
528 t.Errorf("%s produced invalid JSON (OUTPUT-VALIDITY violation): state=%q path=%v",
529 label, state, path)
530 return
531 }
532 if check != nil {
533 check(t, state)
534 }
535}
536
537// FuzzSequence runs multi-operation sequences against a single JSON document.
538//

Callers 1

FuzzSequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected