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))
| 520 | // json.Valid (when input was valid + shape matches), and the per-step |
| 521 | // sequence assertion (passed in as `check`). |
| 522 | func 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 | // |