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

Function TestReaderParserChunkBoundary

reader_parser_test.go:182–195  ·  view source on GitHub ↗

Verifies: SYS-REQ-116 (tokens crossing read boundaries) SYS-REQ-116:boundary:nominal reqproof:proptest:skip targeted chunk-boundary witness

(t *testing.T)

Source from the content-addressed store, hash-verified

180// SYS-REQ-116:boundary:nominal
181// reqproof:proptest:skip targeted chunk-boundary witness
182func TestReaderParserChunkBoundary(t *testing.T) {
183 source := &fixedChunkReader{
184 data: []byte(`{"prefix":0,"message":"a value crossing many tiny chunks","suffix":1}`),
185 chunk: 3,
186 }
187 rp := NewReaderParser(source)
188 value, vt, err := rp.Get("message")
189 if err != nil {
190 t.Fatalf("chunked Get returned error: %v", err)
191 }
192 if vt != String || string(value) != "a value crossing many tiny chunks" {
193 t.Fatalf("chunked Get = (%q, %v)", value, vt)
194 }
195}
196
197// Verifies: SYS-REQ-116 (config-aware streaming)
198// SYS-REQ-116:nominal:nominal

Callers

nothing calls this directly

Calls 2

GetMethod · 0.95
NewReaderParserFunction · 0.85

Tested by

no test coverage detected