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

Function TestSetRange

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

Source from the content-addressed store, hash-verified

150}
151
152func TestSetRange(t *testing.T) {
153 for _, n := range ns {
154 for s := 0; s < n; s++ {
155 for e := s; e < n; e++ {
156 a := New(n)
157 a.SetRange(s, e)
158 msg := fmt.Sprintf("n=%v, s=%v, e=%v", n, s, e)
159 if s > 0 {
160 wrapRequire(t, !a.IsAnySet(0, s-1), "pre: "+msg)
161 }
162 for j := s; j <= e; j++ {
163 wrapRequire(t, a.IsSet(j), "in: "+msg)
164 }
165 if e < n-1 {
166 wrapRequire(t, !a.IsAnySet(e+1, n-1), "post: "+msg)
167 }
168 }
169 }
170 }
171}
172
173func TestClearRange(t *testing.T) {
174 for _, n := range ns {

Callers

nothing calls this directly

Calls 5

wrapRequireFunction · 0.85
SetRangeMethod · 0.80
IsAnySetMethod · 0.80
IsSetMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected