MCPcopy Index your code
hub / github.com/dropbox/godropbox / TestClearRange

Function TestClearRange

container/bitarray/bitarray_test.go:173–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

171}
172
173func TestClearRange(t *testing.T) {
174 for _, n := range ns {
175 for s := 0; s < n; s++ {
176 for e := s; e < n; e++ {
177 a := New(n)
178 a.SetRange(0, n-1)
179 a.ClearRange(s, e)
180 msg := fmt.Sprintf("n=%v, s=%v, e=%v", n, s, e)
181 if s > 0 {
182 wrapRequire(t, !a.IsAnyClear(0, s-1), "pre: "+msg)
183 }
184 for j := s; j <= e; j++ {
185 wrapRequire(t, !a.IsSet(j), "in: "+msg)
186 }
187 if e < n-1 {
188 wrapRequire(t, !a.IsAnyClear(e+1, n-1), "post: "+msg)
189 }
190 }
191 }
192 }
193}

Callers

nothing calls this directly

Calls 6

wrapRequireFunction · 0.85
SetRangeMethod · 0.80
ClearRangeMethod · 0.80
IsAnyClearMethod · 0.80
IsSetMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected