(t *testing.T)
| 315 | } |
| 316 | |
| 317 | func TestReadWriteVarint31(t *testing.T) { |
| 318 | f := func(x uint32) bool { |
| 319 | var buf bytes.Buffer |
| 320 | _, err := WriteVarint31(&buf, uint64(x)) |
| 321 | if err == ErrRange { |
| 322 | return x > math.MaxInt32 |
| 323 | } |
| 324 | v, err := ReadVarint31(NewReader(buf.Bytes())) |
| 325 | return uint32(v) == x && err == nil |
| 326 | } |
| 327 | if err := quick.Check(f, nil); err != nil { |
| 328 | t.Error(err) |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | func TestReadWriteVarint63(t *testing.T) { |
| 333 | f := func(x uint64) bool { |
nothing calls this directly
no test coverage detected