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

Function TestFuzzParseStringHarnessCoverage

mcdc_supplement_test.go:387–400  ·  view source on GitHub ↗

Verifies: SYS-REQ-014 [fuzz] MCDC SYS-REQ-014: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

385// Verifies: SYS-REQ-014 [fuzz]
386// MCDC SYS-REQ-014: N/A
387func TestFuzzParseStringHarnessCoverage(t *testing.T) {
388 if got := FuzzParseString([]byte(`abc`)); got != 1 {
389 t.Fatalf("FuzzParseString success path = %d, want 1", got)
390 }
391 if got := FuzzParseString([]byte(``)); got != 0 {
392 t.Fatalf("FuzzParseString empty string path = %d, want 0", got)
393 }
394 // Per DEFECT-260727-SNGT a lone high surrogate now substitutes U+FFFD (no
395 // error), so \uD800 is no longer malformed. Use a truncated low-surrogate
396 // escape (\uD800\u) to exercise the genuine malformed-escape path.
397 if got := FuzzParseString([]byte(`\uD800\u`)); got != 0 {
398 t.Fatalf("FuzzParseString malformed escape path = %d, want 0", got)
399 }
400}
401
402// Verifies: STK-REQ-001 [malformed]
403// MCDC STK-REQ-001: N/A

Callers

nothing calls this directly

Calls 1

FuzzParseStringFunction · 0.85

Tested by

no test coverage detected