MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestUpdateNeverPanics

Function TestUpdateNeverPanics

libs/bits/bit_array_test.go:191–211  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

189}
190
191func TestUpdateNeverPanics(t *testing.T) {
192 newRandBitArray := func(n int) *BitArray {
193 ba, _ := randBitArray(n)
194 return ba
195 }
196 pairs := []struct {
197 a, b *BitArray
198 }{
199 {nil, nil},
200 {newRandBitArray(10), newRandBitArray(12)},
201 {newRandBitArray(23), newRandBitArray(23)},
202 {newRandBitArray(37), nil},
203 {nil, NewBitArray(10)},
204 }
205
206 for _, pair := range pairs {
207 a, b := pair.a, pair.b
208 a.Update(b)
209 b.Update(a)
210 }
211}
212
213func TestNewBitArrayNeverCrashesOnNegatives(t *testing.T) {
214 bitList := []int{-127, -128, -1 << 31}

Callers

nothing calls this directly

Calls 3

randBitArrayFunction · 0.85
NewBitArrayFunction · 0.85
UpdateMethod · 0.65

Tested by

no test coverage detected