(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestBitWriterBytePadding(t *testing.T) { |
| 92 | // 12 bits written -> 2 bytes, low 4 bits of the last byte are zero padding. |
| 93 | w := NewBitWriter(4) |
| 94 | w.WriteBits(0xABC, 12) |
| 95 | b := w.Bytes() |
| 96 | require.Len(t, b, 2) |
| 97 | require.Equal(t, byte(0xAB), b[0]) |
| 98 | require.Equal(t, byte(0xC0), b[1]) // 0xC in high nibble, padding in low |
| 99 | } |
| 100 | |
| 101 | func TestBitWriterEmpty(t *testing.T) { |
| 102 | w := NewBitWriter(0) |
nothing calls this directly
no test coverage detected
searching dependent graphs…