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

Function TestDecoderObjectDecoderAPI

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

Source from the content-addressed store, hash-verified

1614}
1615
1616func TestDecoderObjectDecoderAPI(t *testing.T) {
1617 json := `{
1618 "test": 245,
1619 "test2": 246,
1620 "test3": "string",
1621 "test4": "complex string with spaces and some slashes\"",
1622 "test5": -1.15657654376543,
1623 "testNull": null,
1624 "testArr": [
1625 {
1626 "test": 245,
1627 "test2": 246
1628 },
1629 {
1630 "test": 245,
1631 "test2": 246
1632 }
1633 ],
1634 "testSubObj": {
1635 "test": 121,
1636 "test2": 122,
1637 "testNull": null,
1638 "testSubSubObj": {
1639 "test": 150,
1640 "testNull": null
1641 },
1642 "testSubSubObj2": {
1643 "test": 150
1644 },
1645 "test3": "string"
1646 "testNull": null,
1647 },
1648 "testSubObj2": {
1649 "test": 122,
1650 "test3": "string"
1651 "testSubSubObj": {
1652 "test": 151
1653 },
1654 "test2": 123
1655 }
1656 }`
1657 v := &TestObj{}
1658 dec := NewDecoder(strings.NewReader(json))
1659 err := dec.DecodeObject(v)
1660 assertResult(t, v, err)
1661}
1662
1663type ReadCloser struct {
1664 json []byte

Callers

nothing calls this directly

Calls 3

DecodeObjectMethod · 0.95
NewDecoderFunction · 0.85
assertResultFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…