update tests

This commit is contained in:
IncSW 2021-06-15 19:10:56 +03:00
parent 9a2f108208
commit 94cecc0609
No known key found for this signature in database
GPG Key ID: 89876FA64BFB2D57
2 changed files with 23 additions and 16 deletions

View File

@ -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)
}

View File

@ -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)
}