add support of the byte array with varint len.

This commit is contained in:
Tnze
2019-06-03 13:01:15 +08:00
parent 6feed6f193
commit 4a0dc34854
3 changed files with 23 additions and 18 deletions

View File

@ -19,7 +19,7 @@ var PackedVarInts = [][]byte{
[]byte{0x80, 0x80, 0x80, 0x80, 0x08},
}
func TestPackInt(t *testing.T) {
func TestPackVarInt(t *testing.T) {
for i, v := range VarInts {
p := v.Encode()
if !bytes.Equal(p, PackedVarInts[i]) {
@ -27,7 +27,7 @@ func TestPackInt(t *testing.T) {
}
}
}
func TestUnpackInt(t *testing.T) {
func TestUnpackVarInt(t *testing.T) {
for i, v := range PackedVarInts {
var vi VarInt
if err := vi.Decode(bytes.NewReader(v)); err != nil {