Verifies: SYS-REQ-116 (malformed and truncated streams) SYS-REQ-116:malformed_input:nominal reqproof:proptest:skip targeted malformed-stream witness
(t *testing.T)
| 165 | // SYS-REQ-116:malformed_input:nominal |
| 166 | // reqproof:proptest:skip targeted malformed-stream witness |
| 167 | func TestReaderParserMalformed(t *testing.T) { |
| 168 | rp := NewReaderParser(strings.NewReader(`{"message":"unterminated`)) |
| 169 | if _, _, err := rp.Get("message"); !errors.Is(err, MalformedStringError) { |
| 170 | t.Fatalf("truncated string error = %v, want MalformedStringError", err) |
| 171 | } |
| 172 | |
| 173 | rp = NewReaderParser(strings.NewReader(`[1,{"open":true}`)) |
| 174 | if err := rp.ArrayEach(func([]byte, ValueType, error) {}); !errors.Is(err, MalformedArrayError) { |
| 175 | t.Fatalf("truncated array error = %v, want MalformedArrayError", err) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | // Verifies: SYS-REQ-116 (tokens crossing read boundaries) |
| 180 | // SYS-REQ-116:boundary:nominal |
nothing calls this directly
no test coverage detected