mirror of
https://github.com/json-iterator/go.git
synced 2024-11-24 08:22:14 +02:00
add tests for #283
This commit is contained in:
parent
8744d7c5c7
commit
720ab8dc7f
6
Gopkg.lock
generated
6
Gopkg.lock
generated
@ -10,12 +10,12 @@
|
|||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/modern-go/reflect2"
|
name = "github.com/modern-go/reflect2"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "1df9eeb2bb81f327b96228865c5687bc2194af3f"
|
revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
|
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "ac7003b5a981716353a43055ab7d4c5357403cb30a60de2dbdeb446c1544beaa"
|
inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
@ -23,4 +23,4 @@ ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com
|
|||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/modern-go/reflect2"
|
name = "github.com/modern-go/reflect2"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
|
@ -61,4 +61,4 @@ func Test_decoder_more(t *testing.T) {
|
|||||||
should := require.New(t)
|
should := require.New(t)
|
||||||
decoder := jsoniter.NewDecoder(bytes.NewBufferString("abcde"))
|
decoder := jsoniter.NewDecoder(bytes.NewBufferString("abcde"))
|
||||||
should.True(decoder.More())
|
should.True(decoder.More())
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ package extra
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/json-iterator/go"
|
"github.com/json-iterator/go"
|
||||||
"unicode"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SupportPrivateFields include private fields when encoding/decoding
|
// SupportPrivateFields include private fields when encoding/decoding
|
||||||
@ -52,4 +52,3 @@ func calcFieldNames(originalFieldName string, tagProvidedFieldName string, whole
|
|||||||
}
|
}
|
||||||
return fieldNames
|
return fieldNames
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +93,13 @@ func init() {
|
|||||||
T float64 `json:"t"`
|
T float64 `json:"t"`
|
||||||
})(nil),
|
})(nil),
|
||||||
input: `{"T":10.0}`,
|
input: `{"T":10.0}`,
|
||||||
|
}, unmarshalCase{
|
||||||
|
ptr: (*struct {
|
||||||
|
KeyString string `json:"key_string"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Asks [][2]float64 `json:"asks"`
|
||||||
|
})(nil),
|
||||||
|
input: `{"key_string": "KEYSTRING","type": "TYPE","asks": [[1e+66,1]]}`,
|
||||||
})
|
})
|
||||||
marshalCases = append(marshalCases,
|
marshalCases = append(marshalCases,
|
||||||
struct {
|
struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user