============================================================================= Shared helpers ============================================================================= encodingJSONNoPanic runs fn and fails the test on panic (Gate A). The panic value and stack are included so a real stdlib bug car
(t *testing.T, label string, data []byte, fn func())
| 111 | // panic value and stack are included so a real stdlib bug carries full |
| 112 | // diagnostic context for the minimizing reproducer. |
| 113 | func encodingJSONNoPanic(t *testing.T, label string, data []byte, fn func()) { |
| 114 | t.Helper() |
| 115 | defer func() { |
| 116 | if r := recover(); r != nil { |
| 117 | t.Errorf("encoding/json PANIC in %s (Gate A / NO-PANIC violation): %v\n%s\ndata=%s", |
| 118 | label, r, debug.Stack(), truncateForMsg(data)) |
| 119 | } |
| 120 | }() |
| 121 | fn() |
| 122 | } |
| 123 | |
| 124 | // truncateForMsg renders a byte slice for inclusion in an error message, |
| 125 | // truncating very large inputs (e.g. the 100 KB deep-nesting seed) so test |
no test coverage detected