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

Function TestReaderParserConfig

reader_parser_test.go:200–217  ·  view source on GitHub ↗

Verifies: SYS-REQ-116 (config-aware streaming) SYS-REQ-116:nominal:nominal reqproof:proptest:skip targeted config witness

(t *testing.T)

Source from the content-addressed store, hash-verified

198// SYS-REQ-116:nominal:nominal
199// reqproof:proptest:skip targeted config witness
200func TestReaderParserConfig(t *testing.T) {
201 rp := NewReaderParser(
202 strings.NewReader(`{'message':'it\'s\q'}`),
203 Config{
204 AllowSingleQuotes: true,
205 AllowUnknownEscapes: true,
206 MaxBufferSize: 8,
207 },
208 )
209
210 got, err := rp.GetString("message")
211 if err != nil {
212 t.Fatalf("lenient GetString returned error: %v", err)
213 }
214 if want := "it'sq"; got != want {
215 t.Fatalf("lenient GetString = %q, want %q", got, want)
216 }
217}
218
219// Verifies: SYS-REQ-116 (empty input)
220// SYS-REQ-116:empty_input:nominal

Callers

nothing calls this directly

Calls 2

GetStringMethod · 0.95
NewReaderParserFunction · 0.85

Tested by

no test coverage detected