(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func TestDecodeStreamDecodePooledDecoderError2(t *testing.T) { |
| 40 | // we override the pool chan |
| 41 | dec := Stream.NewDecoder(nil) |
| 42 | dec.Release() |
| 43 | defer func() { |
| 44 | err := recover() |
| 45 | assert.NotNil(t, err, "err shouldnt be nil") |
| 46 | assert.IsType(t, InvalidUsagePooledDecoderError(""), err, "err should be of type InvalidUsagePooledDecoderError") |
| 47 | assert.Equal(t, "Invalid usage of pooled decoder", err.(InvalidUsagePooledDecoderError).Error(), "err should be of type InvalidUsagePooledDecoderError") |
| 48 | }() |
| 49 | var v = TestObj{} |
| 50 | dec.DecodeObject(&v) |
| 51 | // make sure they are the same |
| 52 | assert.True(t, false, "should not be called as decoder should have panicked") |
| 53 | } |
| 54 | |
| 55 | func TestStreamDecoderNewPool(t *testing.T) { |
| 56 | dec := newStreamDecoderPool() |
nothing calls this directly
no test coverage detected
searching dependent graphs…