MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestGetMultiple

Function TestGetMultiple

consistent/consistent_test.go:198–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

196}
197
198func TestGetMultiple(t *testing.T) {
199 kms.Unittest = true
200 utils.RemoveAll(testStorePath + "*")
201 kms.ResetBucket()
202
203 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
204 defer utils.RemoveAll(testStorePath + "*")
205 x.Add(NewNodeFromString("0000000000000000000000000000000000000000000000000000000000000000"))
206 x.Add(NewNodeFromString("1111111111111111111111111111111111111111111111111111111111111111"))
207 x.Add(NewNodeFromString("2222222222222222222222222222222222222222222222222222222222222222"))
208 for i, v := range gmtests {
209 result, err := x.GetNeighbor(v.in)
210 if err != nil {
211 t.Fatal(err)
212 }
213 if string(result.ID) != v.out {
214 t.Errorf("%d. got %v, expected %v", i, result, v.out)
215 }
216 }
217}
218
219func TestGetMultipleQuick(t *testing.T) {
220 kms.Unittest = true

Callers

nothing calls this directly

Calls 8

RemoveAllFunction · 0.92
ResetBucketFunction · 0.92
InitConsistentFunction · 0.85
NewNodeFromStringFunction · 0.85
GetNeighborMethod · 0.80
FatalMethod · 0.80
ErrorfMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected