(t *testing.T)
| 502 | } |
| 503 | |
| 504 | func TestDecoderSliceDecoderAPI(t *testing.T) { |
| 505 | json := `["string","string1"]` |
| 506 | testArr := testSliceStrings{} |
| 507 | dec := NewDecoder(strings.NewReader(json)) |
| 508 | err := dec.DecodeArray(&testArr) |
| 509 | assert.Nil(t, err, "Err must be nil") |
| 510 | assert.Len(t, testArr, 2, "testArr should be of len 2") |
| 511 | assert.Equal(t, "string", testArr[0], "testArr[0] should be 'string'") |
| 512 | assert.Equal(t, "string1", testArr[1], "testArr[1] should be 'string1'") |
| 513 | } |
| 514 | |
| 515 | func TestDecoderSliceDecoderAPIError(t *testing.T) { |
| 516 | testArr := testSliceInts{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…