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

Function TestGetMultipleRemoveQuick

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

Source from the content-addressed store, hash-verified

284}
285
286func TestGetMultipleRemoveQuick(t *testing.T) {
287 kms.Unittest = true
288 utils.RemoveAll(testStorePath + "*")
289 kms.ResetBucket()
290
291 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
292 defer utils.RemoveAll(testStorePath + "*")
293 x.Add(NewNodeFromString("0000000000000000000000000000000000000000000000000000000000000000"))
294 x.Add(NewNodeFromString("1111111111111111111111111111111111111111111111111111111111111111"))
295 x.Add(NewNodeFromString("2222222222222222222222222222222222222222222222222222222222222222"))
296 x.Remove(NodeID("2222222222222222222222222222222222222222222222222222222222222222"))
297 f := func(s string) bool {
298 y, err := x.GetNeighbor(s)
299 if err != nil {
300 t.Logf("error: %v", err)
301 return false
302 }
303 //t.Logf("s = %v, y = %v", s, y)
304 return y.ID == "0000000000000000000000000000000000000000000000000000000000000000" || y.ID == "1111111111111111111111111111111111111111111111111111111111111111"
305 }
306 if err := quick.Check(f, nil); err != nil {
307 t.Fatal(err)
308 }
309}
310
311func TestGetTwo(t *testing.T) {
312 kms.Unittest = true

Callers

nothing calls this directly

Calls 10

RemoveAllFunction · 0.92
ResetBucketFunction · 0.92
InitConsistentFunction · 0.85
NewNodeFromStringFunction · 0.85
NodeIDTypeAlias · 0.85
GetNeighborMethod · 0.80
FatalMethod · 0.80
CheckMethod · 0.65
AddMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected