gojay

high performance JSON encoder/decoder with stream API for Golang
git clone git://git.lair.cx/gojay
Log | Files | Refs | README | LICENSE

commit 5902817c4570f7dd39bc9a86f723d287e05e8e08
parent 6a58a698ecd2204199ab86db9d1dfd9a7031dc77
Author: francoispqt <francois@parquet.ninja>
Date:   Sun, 12 Aug 2018 01:41:00 +0800

add tests for skip array and skip objects

Diffstat:
Mdecode_array_test.go | 7+++++++
Mdecode_object_test.go | 5+++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/decode_array_test.go b/decode_array_test.go @@ -534,6 +534,13 @@ func TestSkipArray(t *testing.T) { assert.Nil(t, err) }, }, + { + json: `"test \n"]`, + expectations: func(t *testing.T, i int, err error) { + assert.Equal(t, len(`"test \n"]`), i) + assert.Nil(t, err) + }, + }, } for _, test := range testCases { diff --git a/decode_object_test.go b/decode_object_test.go @@ -1382,6 +1382,11 @@ func TestSkipObject(t *testing.T) { json: `{"key":"value"`, err: true, }, + { + name: "basic-err2", + json: `"key":"value\n"}`, + err: false, + }, } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) {