============================================================================= SEQUENCE fuzzer (closes Dimension 2: interaction / sequence coverage) ============================================================================= Every existing fuzzer runs ONE operation per input. Real bugs live in SEQ
(t *testing.T, state []byte, op string, path []string, val []byte)
| 487 | // returns the new state. Returns (newState, ok). ok=false means the op |
| 488 | // errored and the sequence should restart from a prior valid state. |
| 489 | func applySequenceStep(t *testing.T, state []byte, op string, path []string, val []byte) ([]byte, bool) { |
| 490 | t.Helper() |
| 491 | defer func() { |
| 492 | if r := recover(); r != nil { |
| 493 | t.Errorf("PANIC in sequence step %s (NO-PANIC violation): %v\n%s\nstate=%q path=%v", |
| 494 | op, r, debug.Stack(), state, path) |
| 495 | } |
| 496 | }() |
| 497 | clone := make([]byte, len(state)) |
| 498 | copy(clone, state) |
| 499 | switch op { |
| 500 | case "set": |
| 501 | out, err := Set(clone, val, path...) |
| 502 | if err != nil { |
| 503 | return state, false |
| 504 | } |
| 505 | return out, true |
| 506 | case "delete": |
| 507 | out := Delete(clone, path...) |
| 508 | return out, true |
| 509 | } |
| 510 | return state, false |
| 511 | } |
| 512 | |
| 513 | // assertAfterStep runs the post-step invariants: no panic (caught above), |
| 514 | // json.Valid (when input was valid + shape matches), and the per-step |
no test coverage detected