MCPcopy Create free account
hub / github.com/dadgar/onecache / fillNode

Function fillNode

onecache/replicator_test.go:30–42  ·  view source on GitHub ↗

Fills a node with key/value pairs with no flags and no expiration. Returns a list of the inserted data. Each entry represents a KV pair since keys equal their values.

(t *testing.T, n *Node, numKeys int)

Source from the content-addressed store, hash-verified

28// Fills a node with key/value pairs with no flags and no expiration. Returns a list of the inserted data. Each entry
29// represents a KV pair since keys equal their values.
30func fillNode(t *testing.T, n *Node, numKeys int) []string {
31 var keysAndValues []string
32 for i := 0; i < numKeys; i++ {
33 d := fmt.Sprintf("%d", i)
34 keysAndValues = append(keysAndValues, d)
35
36 if err := n.data.Set(d, []byte(d), 0, 0); err != nil {
37 t.Fatalf("Set(%v) failed: %v", d, err)
38 }
39 }
40
41 return keysAndValues
42}
43
44func TestMarkPeersDirtySingle(t *testing.T) {
45 nodes, err := connectedTestNodes(2, 2)

Callers 4

TestMarkPeersDirtySingleFunction · 0.85

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected