MCPcopy Create free account
hub / github.com/egonelbre/exp / testRandomBits

Function testRandomBits

bit/bit_test.go:51–59  ·  view source on GitHub ↗
(t *testing.T, N int)

Source from the content-addressed store, hash-verified

49func TestWriteReadRandomBitsLarge(t *testing.T) { testRandomBits(t, 1251) }
50
51func testRandomBits(t *testing.T, N int) {
52 values := make([]pair, N)
53 for i := range values {
54 width := uint(rand.Intn(61) + 1)
55 value := uint64(rand.Intn(1<<width - 1))
56 values[i] = pair{value, width}
57 }
58 testReadWrite(t, values)
59}
60
61type pair struct {
62 value uint64

Callers 2

Calls 1

testReadWriteFunction · 0.85

Tested by

no test coverage detected