// TestIncIndex tests that the index will increment or wrap.
TestIncIndex tests that the index will increment or wrap.
// TestIncIndex tests that the index will increment or wrap .
func TestIncIndex(t *testing.T) {
	tests := []struct {
		bytes int
		index int
		want  int
	}{
		{1, 0, 1}, {1, 7, 0},
		{2, 0, 1}, {2, 7, 8}, {2, 15, 0},
	}
	for _, tt := range tests {
		r := &Reader{
			bytes: make([]byte, tt.bytes),
			avail: tt.bytes,
			index: tt.index,
		}
		r.incIndex()
		if r.index != tt.want {
			t.Errorf(
				`Increment from %d = %d, want %d`,
				tt.index, r.index, tt.want,
			)
		}
	}
}
func TestIncIndex ( t * testing . T ) { tests := [ ] struct { bytes int index int want int } { { 1 , 0 , 1 } , { 1 , 7 , 0 } , { 2 , 0 , 1 } , { 2 , 7 , 8 } , { 2 , 15 , 0 } , } for _ , tt := range tests { r := & Reader { bytes : make ( [ ] byte , tt . bytes ) , avail : tt . bytes , index : tt . index , } r . incIndex ( ) if r . index != tt . want { t . Errorf ( `Increment from %d = %d, want %d` , tt . index , r . index , tt . want , ) } } }
TestIncIndex tests that the index will increment or wrap.
TestIncIndex tests that the index will increment or wrap .