Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IncSW committed Jun 15, 2021
1 parent 9a2f108 commit 94cecc0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
23 changes: 23 additions & 0 deletions decode_test.go
Expand Up @@ -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)
}
16 changes: 0 additions & 16 deletions encode_test.go
Expand Up @@ -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)
}

0 comments on commit 94cecc0

Please sign in to comment.