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

Function assertAfterStep

path_fuzz_test.go:516–529  ·  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

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

Callers 1

FuzzSequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected