Regression coverage for the empty-string key path component hazard (hazard-sweep finding). A caller passing "" as a path component used to trigger `runtime error: index out of range [0] with length 0` at the unguarded `keys[i][0]` / `p[level][0]` dereference sites in searchKeys, EachKey, createInser
(t *testing.T, name string, fn func())
| 21 | // runNoPanic executes fn and fails the test if it panics, returning the |
| 22 | // recovered value so callers can also assert on the post-fix result. |
| 23 | func runNoPanic(t *testing.T, name string, fn func()) { |
| 24 | t.Helper() |
| 25 | defer func() { |
| 26 | if r := recover(); r != nil { |
| 27 | t.Fatalf("%s panicked (empty-key regression): %v", name, r) |
| 28 | } |
| 29 | }() |
| 30 | fn() |
| 31 | } |
| 32 | |
| 33 | // ============================================================================= |
| 34 | // Get family — empty key component resolves to KeyPathNotFoundError (SYS-REQ-016) |
no outgoing calls
no test coverage detected