lotus/lib/rlepluslazy/bitvec_test.go
Jakub Sztandera 353fef3ff6
Improve complex code and comment it
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-12-07 15:48:20 +01:00

22 lines
312 B
Go

package rlepluslazy
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestReadBitVec(t *testing.T) {
buf := []byte{0x0, 0xff}
bv := readBitvec(buf)
o := bv.Get(1)
assert.EqualValues(t, 0, o)
o = bv.Get(8)
assert.EqualValues(t, 0x80, o)
o = bv.Get(7)
assert.EqualValues(t, 0x7f, o)
}