MCPcopy Index your code
hub / github.com/CodisLabs/codis / TestHashSlot

Function TestHashSlot

pkg/proxy/mapper_test.go:145–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

143}
144
145func TestHashSlot(t *testing.T) {
146 var m = map[string]string{
147 "{abc}": "abc",
148 "{{{abc1}abc2}": "{{abc1",
149 "abc1{abc2{abc3}": "abc2{abc3",
150 "{{{{abc": "{{{{abc",
151 "{{{{abc}": "{{{abc",
152 "{{}{{abc": "{",
153 "abc}{abc": "abc}{abc",
154 "abc}{123}456": "123",
155 "123{abc}456": "abc",
156 "{}abc": "",
157 "abc{}123": "",
158 "123{456}": "456",
159 }
160 for k, v := range m {
161 i := Hash([]byte(k))
162 j := Hash([]byte(v))
163 assert.Must(i == j)
164 }
165}

Callers

nothing calls this directly

Calls 1

HashFunction · 0.85

Tested by

no test coverage detected