MCPcopy Create free account
hub / github.com/francoispqt/gojay / TestDecoderObjectInvalidJSON

Function TestDecoderObjectInvalidJSON

decode_object_test.go:1569–1581  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1567}
1568
1569func 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
1583type myMap map[string]string
1584

Callers

nothing calls this directly

Calls 3

DecodeObjectMethod · 0.95
NewDecoderFunction · 0.85
InvalidJSONErrorTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…