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

Function TestGetMultipleQuick

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

Source from the content-addressed store, hash-verified

217}
218
219func TestGetMultipleQuick(t *testing.T) {
220 kms.Unittest = true
221 utils.RemoveAll(testStorePath + "*")
222 kms.ResetBucket()
223
224 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
225 defer utils.RemoveAll(testStorePath + "*")
226 x.Add(NewNodeFromString("0000000000000000000000000000000000000000000000000000000000000000"))
227 x.Add(NewNodeFromString("1111111111111111111111111111111111111111111111111111111111111111"))
228 x.Add(NewNodeFromString("2222222222222222222222222222222222222222222222222222222222222222"))
229 f := func(s string) bool {
230 y, err := x.GetNeighbor(s)
231 if err != nil {
232 t.Logf("error: %v", err)
233 return false
234 }
235 //t.Logf("s = %v, y = %v", s, y)
236 return y.ID == "0000000000000000000000000000000000000000000000000000000000000000" || y.ID == "1111111111111111111111111111111111111111111111111111111111111111" || y.ID == "2222222222222222222222222222222222222222222222222222222222222222"
237 }
238 if err := quick.Check(f, nil); err != nil {
239 t.Fatal(err)
240 }
241}
242
243var rtestsBefore = []gtest{
244 {"0000", "2222222222222222222222222222222222222222222222222222222222222222"},

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
CheckMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected