From 720ab8dc7f30224c924d13f0865950bc6fd7dcea Mon Sep 17 00:00:00 2001 From: Tao Wen Date: Sun, 1 Jul 2018 13:05:25 +0800 Subject: [PATCH] add tests for #283 --- Gopkg.lock | 6 +++--- Gopkg.toml | 2 +- api_tests/decoder_test.go | 2 +- extra/privat_fields.go | 3 +-- value_tests/struct_test.go | 7 +++++++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 338f1c6..c8a9fbb 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -10,12 +10,12 @@ [[projects]] name = "github.com/modern-go/reflect2" packages = ["."] - revision = "1df9eeb2bb81f327b96228865c5687bc2194af3f" - version = "1.0.0" + revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" + version = "1.0.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "ac7003b5a981716353a43055ab7d4c5357403cb30a60de2dbdeb446c1544beaa" + inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 5801ffa..313a0f8 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -23,4 +23,4 @@ ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com [[constraint]] name = "github.com/modern-go/reflect2" - version = "1.0.0" + version = "1.0.1" diff --git a/api_tests/decoder_test.go b/api_tests/decoder_test.go index 8e1c160..e325ef3 100644 --- a/api_tests/decoder_test.go +++ b/api_tests/decoder_test.go @@ -61,4 +61,4 @@ func Test_decoder_more(t *testing.T) { should := require.New(t) decoder := jsoniter.NewDecoder(bytes.NewBufferString("abcde")) should.True(decoder.More()) -} \ No newline at end of file +} diff --git a/extra/privat_fields.go b/extra/privat_fields.go index 0cfd549..cbebe5c 100644 --- a/extra/privat_fields.go +++ b/extra/privat_fields.go @@ -2,8 +2,8 @@ package extra import ( "github.com/json-iterator/go" - "unicode" "strings" + "unicode" ) // SupportPrivateFields include private fields when encoding/decoding @@ -52,4 +52,3 @@ func calcFieldNames(originalFieldName string, tagProvidedFieldName string, whole } return fieldNames } - diff --git a/value_tests/struct_test.go b/value_tests/struct_test.go index 067ad22..10ace5c 100644 --- a/value_tests/struct_test.go +++ b/value_tests/struct_test.go @@ -93,6 +93,13 @@ func init() { T float64 `json:"t"` })(nil), 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, struct {