MCPcopy Create free account
hub / github.com/buraksezer/consistent / TestConsistentAdd

Function TestConsistentAdd

consistent_test.go:56–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestConsistentAdd(t *testing.T) {
57 cfg := newConfig()
58 c := New(nil, cfg)
59 members := make(map[string]struct{})
60 for i := 0; i < 8; i++ {
61 member := testMember(fmt.Sprintf("node%d.olric", i))
62 members[member.String()] = struct{}{}
63 c.Add(member)
64 }
65 for member := range members {
66 found := false
67 for _, mem := range c.GetMembers() {
68 if member == mem.String() {
69 found = true
70 }
71 }
72 if !found {
73 t.Fatalf("%s could not be found", member)
74 }
75 }
76}
77
78func TestConsistentRemove(t *testing.T) {
79 var members []Member

Callers

nothing calls this directly

Calls 6

newConfigFunction · 0.85
NewFunction · 0.85
testMemberTypeAlias · 0.85
AddMethod · 0.80
GetMembersMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…