MCPcopy
hub / github.com/grafana/dskit / TestSearchToken

Function TestSearchToken

ring/util_test.go:473–481  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

471}
472
473func TestSearchToken(t *testing.T) {
474 tokens := []uint32{3, 5}
475
476 assert.Equal(t, 0, searchToken(tokens, 0))
477 assert.Equal(t, 1, searchToken(tokens, 3))
478 assert.Equal(t, 1, searchToken(tokens, 4))
479 assert.Equal(t, 0, searchToken(tokens, 5))
480 assert.Equal(t, 0, searchToken(tokens, 7))
481}
482
483func BenchmarkSearchToken(b *testing.B) {
484 r := rand.New(rand.NewSource(time.Now().UnixNano()))

Callers

nothing calls this directly

Calls 2

searchTokenFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected