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

Function TestStress_EachKey_LargeNestedSkip

dead_code_audit_test.go:620–639  ·  view source on GitHub ↗

Verifies: SYS-REQ-008 [boundary]

(t *testing.T)

Source from the content-addressed store, hash-verified

618
619// Verifies: SYS-REQ-008 [boundary]
620func TestStress_EachKey_LargeNestedSkip(t *testing.T) {
621 // Build a large nested object that must be skipped
622 inner := `{"a":{"b":{"c":{"d":"deep"}}}}`
623 data := fmt.Sprintf(`{"skip":%s,"want":"found"}`, inner)
624 paths := [][]string{{"want"}}
625
626 var found bool
627 EachKey([]byte(data), func(idx int, value []byte, vt ValueType, err error) {
628 if idx == 0 {
629 found = true
630 if string(value) != "found" {
631 t.Fatalf("expected 'found', got %q", value)
632 }
633 }
634 }, paths...)
635
636 if !found {
637 t.Fatal("EachKey failed to find 'want' after large nested skip")
638 }
639}
640
641// Verifies: SYS-REQ-010 [boundary]
642func TestStress_Delete_TokenEndBoundary(t *testing.T) {

Callers

nothing calls this directly

Calls 1

EachKeyFunction · 0.85

Tested by

no test coverage detected