You've already forked json-iterator
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:
@@ -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) {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user