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

Function TestStress_Delete_TokenEndBoundary

dead_code_audit_test.go:642–653  ·  view source on GitHub ↗

Verifies: SYS-REQ-010 [boundary]

(t *testing.T)

Source from the content-addressed store, hash-verified

640
641// Verifies: SYS-REQ-010 [boundary]
642func TestStress_Delete_TokenEndBoundary(t *testing.T) {
643 // Test Delete where tokenEnd reaches the sentinel (returns len(data))
644 // This exercises the new `endOffset+tokEnd >= len(data)` guard
645 result := Delete([]byte(`{"a":1,"b":2}`), "b")
646 val, _, _, err := Get(result, "a")
647 if err != nil {
648 t.Fatalf("after delete, failed to get 'a': %v", err)
649 }
650 if string(val) != "1" {
651 t.Fatalf("after delete, 'a' = %q, want '1'", val)
652 }
653}
654
655// Verifies: SYS-REQ-001 [boundary]
656func TestStress_Get_BareTruncatedValue(t *testing.T) {

Callers

nothing calls this directly

Calls 2

DeleteFunction · 0.85
GetFunction · 0.85

Tested by

no test coverage detected