actually this is the correct behavior

This commit is contained in:
Alex Grintsvayg 2018-04-24 21:13:48 -04:00
parent 3d4253b934
commit 6c081ec54b

View file

@ -31,28 +31,28 @@ func TestNodeFinder_FindNodes(t *testing.T) {
t.Fatal("something was found, but it should not have been") t.Fatal("something was found, but it should not have been")
} }
if len(foundNodes) != 2 { if len(foundNodes) != 1 {
t.Errorf("expected 2 nodes, found %d", len(foundNodes)) t.Errorf("expected 1 node, found %d", len(foundNodes))
} }
foundOne := false foundOne := false
foundTwo := false //foundTwo := false
for _, n := range foundNodes { for _, n := range foundNodes {
if n.id.Equals(dhts[0].node.id) { if n.id.Equals(dhts[0].node.id) {
foundOne = true foundOne = true
} }
if n.id.Equals(dhts[1].node.id) { //if n.id.Equals(dhts[1].node.id) {
foundTwo = true // foundTwo = true
} //}
} }
if !foundOne { if !foundOne {
t.Errorf("did not find first node %s", dhts[0].node.id.Hex()) t.Errorf("did not find first node %s", dhts[0].node.id.Hex())
} }
if !foundTwo { //if !foundTwo {
t.Errorf("did not find second node %s", dhts[1].node.id.Hex()) // t.Errorf("did not find second node %s", dhts[1].node.id.Hex())
} //}
} }
func TestNodeFinder_FindValue(t *testing.T) { func TestNodeFinder_FindValue(t *testing.T) {