// TestHasPendingBits checks that it returns true if bits are pending, false
// otherwise.
TestHasPendingBits checks that it returns true if bits are pending, false
otherwise.
// TestHasPendingBits checks that it returns true if bits are pending false // otherwise .
func TestHasPendingBits(t *testing.T) {
	var b bytes.Buffer
	w := NewWriter(&b, 1)
	tests := []struct {
		test func()
		want bool
	}{
		{func() {}, false},
		{func() { w.WriteBit(1) }, true},
		{func() { w.WriteBits(0, 3) }, true},
		{func() { w.Commit() }, false},
	}
	for i, tt := range tests {
		t.Logf(`TestHasPendingBits %d`, i)
		tt.test()
		if actual := w.HasPendingBits(); actual != tt.want {
			t.Errorf(`HasPendingBits() = %v, want %v`, actual, tt.want)
		}
	}
}
func TestHasPendingBits ( t * testing . T ) { var b bytes . Buffer w := NewWriter ( & b , 1 ) tests := [ ] struct { test func ( ) want bool } { { func ( ) { } , false } , { func ( ) { w . WriteBit ( 1 ) } , true } , { func ( ) { w . WriteBits ( 0 , 3 ) } , true } , { func ( ) { w . Commit ( ) } , false } , } for i , tt := range tests { t . Logf ( `TestHasPendingBits %d` , i ) tt . test ( ) if actual := w . HasPendingBits ( ) ; actual != tt . want { t . Errorf ( `HasPendingBits() = %v, want %v` , actual , tt . want ) } } }
TestHasPendingBits checks that it returns true if bits are pending, false
otherwise.
TestHasPendingBits checks that it returns true if bits are pending false otherwise .