(t *testing.T)
| 446 | } |
| 447 | |
| 448 | func TestSlice(t *testing.T) { |
| 449 | testType(t, &Tslice{X: []int{}}, &Xslice{X: []int{}}) |
| 450 | testCycle(t, &Tslice{X: []int{42, -42, 44}}, &Xslice{X: []int{}}) |
| 451 | |
| 452 | x := Xslice{X: []int{222}} |
| 453 | buf := []byte(`{"X": null}`) |
| 454 | err := json.Unmarshal(buf, &x) |
| 455 | require.NoError(t, err, "Unmarshal of null into slice.") |
| 456 | var eq []int |
| 457 | require.Equal(t, x.X, eq) |
| 458 | } |
| 459 | |
| 460 | func TestSlicePtr(t *testing.T) { |
| 461 | testType(t, &TslicePtr{X: []*int{}}, &XslicePtr{X: []*int{}}) |