1
0
mirror of https://github.com/json-iterator/go.git synced 2025-11-29 22:47:28 +02:00

#133 validate json when Skip()

This commit is contained in:
Tao Wen
2017-07-18 09:45:25 +08:00
parent 5eded4f6ae
commit f6da8e62c3
14 changed files with 88 additions and 44 deletions

View File

@@ -2,18 +2,18 @@ package test
import (
"encoding/json"
"errors"
"github.com/json-iterator/go"
"github.com/stretchr/testify/require"
"io"
"testing"
"github.com/stretchr/testify/require"
"github.com/json-iterator/go"
"errors"
)
func Test_skip(t *testing.T) {
for _, input := range inputs {
t.Run(input, func(t *testing.T) {
should := require.New(t)
dst := typeForTest(0)
var dst typeForTest
stdErr := json.Unmarshal([]byte(input), &dst)
iter := jsoniter.ParseString(jsoniter.ConfigDefault, input)
iter.Skip()
@@ -31,4 +31,4 @@ func Test_skip(t *testing.T) {
}
})
}
}
}