(t *testing.T)
| 1567 | } |
| 1568 | |
| 1569 | func TestDecoderObjectInvalidJSON(t *testing.T) { |
| 1570 | result := jsonDecodePartial{} |
| 1571 | dec := NewDecoder(nil) |
| 1572 | dec.data = []byte(`{ |
| 1573 | "test2": "test", |
| 1574 | "testArrSkip": ["test"], |
| 1575 | "testSkipString": "testInvalidJSON\\\\ |
| 1576 | }`) |
| 1577 | dec.length = len(dec.data) |
| 1578 | err := dec.DecodeObject(&result) |
| 1579 | assert.NotNil(t, err, "Err must not be nil as JSON is invalid") |
| 1580 | assert.IsType(t, InvalidJSONError(""), err, "err message must be 'Invalid JSON'") |
| 1581 | } |
| 1582 | |
| 1583 | type myMap map[string]string |
| 1584 |
nothing calls this directly
no test coverage detected
searching dependent graphs…