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

Function TestGetSingle

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

Source from the content-addressed store, hash-verified

140}
141
142func TestGetSingle(t *testing.T) {
143 kms.Unittest = true
144 utils.RemoveAll(testStorePath + "*")
145 kms.ResetBucket()
146
147 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
148 defer utils.RemoveAll(testStorePath + "*")
149 x.Add(NewNodeFromString("0000000000000000000000000000000000000000000000000000000000000000"))
150 f := func(s string) bool {
151 y, err := x.GetNeighbor(s)
152 if err != nil {
153 t.Logf("error: %v", err)
154 return false
155 }
156 //t.Logf("s = %v, y = %v", s, y)
157 return y.ID == "0000000000000000000000000000000000000000000000000000000000000000"
158 }
159 if err := quick.Check(f, nil); err != nil {
160 t.Fatal(err)
161 }
162}
163func TestConsistent_GetNode(t *testing.T) {
164 kms.Unittest = true
165 utils.RemoveAll(testStorePath + "*")

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