From 94cecc06094f8b5fb3f487563fd7b8131573655e Mon Sep 17 00:00:00 2001 From: IncSW Date: Tue, 15 Jun 2021 19:10:56 +0300 Subject: [PATCH] update tests --- decode_test.go | 23 +++++++++++++++++++++++ encode_test.go | 16 ---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/decode_test.go b/decode_test.go index f578de2..fb00c36 100644 --- a/decode_test.go +++ b/decode_test.go @@ -3666,3 +3666,26 @@ func TestDecodeContextOption(t *testing.T) { } }) } + +func TestIssue251(t *testing.T) { + array := [3]int{1, 2, 3} + err := stdjson.Unmarshal([]byte("[ ]"), &array) + if err != nil { + t.Fatal(err) + } + t.Log(array) + + array = [3]int{1, 2, 3} + err = json.Unmarshal([]byte("[ ]"), &array) + if err != nil { + t.Fatal(err) + } + t.Log(array) + + array = [3]int{1, 2, 3} + err = json.NewDecoder(strings.NewReader(`[ ]`)).Decode(&array) + if err != nil { + t.Fatal(err) + } + t.Log(array) +} diff --git a/encode_test.go b/encode_test.go index c970188..41a14cc 100644 --- a/encode_test.go +++ b/encode_test.go @@ -1958,19 +1958,3 @@ func TestEncodeContextOption(t *testing.T) { } }) } - -func TestIssue251(t *testing.T) { - array := [3]int{1, 2, 3} - err := stdjson.Unmarshal([]byte("[ ]"), &array) - if err != nil { - t.Fatal(err) - } - t.Log(array) - - array = [3]int{1, 2, 3} - err = json.Unmarshal([]byte("[ ]"), &array) - if err != nil { - t.Fatal(err) - } - t.Log(array) -}