(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestEncodeDecodeVarint(t *testing.T) { |
| 13 | b := [8]byte{} |
| 14 | |
| 15 | n, err := encodeVarint(b[:], 42) |
| 16 | if err != nil { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | |
| 20 | v, n2, err := decodeVarint(b[:n]) |
| 21 | if err != nil { |
| 22 | t.Fatal(err) |
| 23 | } |
| 24 | if v != 42 { |
| 25 | t.Errorf("decoded value mismatch: want %d, got %d", 42, v) |
| 26 | } |
| 27 | if n2 != n { |
| 28 | t.Errorf("decoded byte count mismatch: want %d, got %d", n, n2) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | func TestEncodeDecodeVarintZigZag(t *testing.T) { |
| 33 | b := [8]byte{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…