Skip to content

Commit

Permalink
move test
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Nov 22, 2024
1 parent 5bbf88c commit f6f80cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 15 additions & 0 deletions decoder/decoder_native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ import (
"github.com/stretchr/testify/require"
)

func TestDecoder_OptionCaseSensitive(t *testing.T) {
var js = `{"a":1,"normallllll":1,"longllllllllllllllllllllllllllllllllll":1}`
type TS struct{
A int
Normallllll int
Longllllllllllllllllllllllllllllllllll int
}
var obj = TS{}
d := NewDecoder(js)
d.SetOptions(OptionCaseSensitive)
err := d.Decode(&obj)
require.NoError(t, err)
require.Equal(t, TS{}, obj)
}


func BenchmarkSkipValidate(b *testing.B) {
type skiptype struct {
Expand Down
15 changes: 0 additions & 15 deletions decoder/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,21 +295,6 @@ func TestDecoder_MapWithIndirectElement(t *testing.T) {
assert.Equal(t, [129]byte{1, 2, 3, 4, 5}, v[""].A)
}

func TestDecoder_OptionCaseSensitive(t *testing.T) {
var js = `{"a":1,"normallllll":1,"longllllllllllllllllllllllllllllllllll":1}`
type TS struct{
A int
Normallllll int
Longllllllllllllllllllllllllllllllllll int
}
var obj = TS{}
d := NewDecoder(js)
d.SetOptions(OptionCaseSensitive)
err := d.Decode(&obj)
require.NoError(t, err)
require.Equal(t, TS{}, obj)
}

func BenchmarkDecoder_Generic_Sonic(b *testing.B) {
var w interface{}
_, _ = decode(TwitterJson, &w, true)
Expand Down

0 comments on commit f6f80cf

Please sign in to comment.