(t *testing.T)
| 660 | } |
| 661 | |
| 662 | func TestDecoderStringPoolError(t *testing.T) { |
| 663 | // reset the pool to make sure it's not full |
| 664 | decPool = sync.Pool{ |
| 665 | New: func() interface{} { |
| 666 | return NewDecoder(nil) |
| 667 | }, |
| 668 | } |
| 669 | result := "" |
| 670 | dec := NewDecoder(nil) |
| 671 | dec.Release() |
| 672 | defer func() { |
| 673 | err := recover() |
| 674 | assert.NotNil(t, err, "err shouldnt be nil") |
| 675 | assert.IsType(t, InvalidUsagePooledDecoderError(""), err, "err should be of type InvalidUsagePooledDecoderError") |
| 676 | }() |
| 677 | _ = dec.DecodeString(&result) |
| 678 | assert.True(t, false, "should not be called as decoder should have panicked") |
| 679 | } |
| 680 | |
| 681 | func TestDecoderSkipEscapedStringError(t *testing.T) { |
| 682 | dec := NewDecoder(strings.NewReader(``)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…