MCPcopy
hub / github.com/grafana/tempo / TestBucketFor

Function TestBucketFor

pkg/tempopb/pool_test.go:75–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestBucketFor(t *testing.T) {
76 testPool := NewPool("foo", 5, 10, 5)
77 cases := []struct {
78 size int
79 expected int
80 }{
81 {
82 size: 0,
83 expected: -1,
84 },
85 {
86 size: 5,
87 expected: -1,
88 },
89 {
90 size: 6,
91 expected: 0,
92 },
93 {
94 size: 10,
95 expected: 0,
96 },
97 {
98 size: 11,
99 expected: 1,
100 },
101 {
102 size: 15,
103 expected: 1,
104 },
105 {
106 size: 16,
107 expected: 2,
108 },
109 }
110 for _, c := range cases {
111 ret := testPool.bucketFor(c.size)
112 require.Equal(t, c.expected, ret, "size: %d", c.size)
113 }
114}

Callers

nothing calls this directly

Calls 3

bucketForMethod · 0.95
NewPoolFunction · 0.70
EqualMethod · 0.45

Tested by

no test coverage detected