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

Function TestRemoval5_SearchKeys_ArrayIndex_Valid

dead_code_audit_test.go:401–408  ·  view source on GitHub ↗

============================================================================= REMOVAL 5: `keys[level][0] != '['` removed in searchKeys The original code was: `keys[level][0] != '[' || keys[level][keyLen-1] != ']'` within `if keyLevel == level && keys[level][0] == '['` So keys[level][0] != '[' was AL

(t *testing.T)

Source from the content-addressed store, hash-verified

399
400// Verifies: SYS-REQ-001 [boundary]
401func TestRemoval5_SearchKeys_ArrayIndex_Valid(t *testing.T) {
402 data := []byte(`[1, "two", 3]`)
403 // searchKeys with "[1]" should find element at index 1
404 offset := searchKeys(data, "[1]")
405 if offset == -1 {
406 t.Fatal("searchKeys failed to find array index [1]")
407 }
408}
409
410// Verifies: SYS-REQ-001 [boundary]
411func TestRemoval5_SearchKeys_ArrayIndex_MalformedNoClose(t *testing.T) {

Callers

nothing calls this directly

Calls 1

searchKeysFunction · 0.85

Tested by

no test coverage detected