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")
}
if len(foundNodes) != 2 {
t.Errorf("expected 2 nodes, found %d", len(foundNodes))
if len(foundNodes) != 1 {
t.Errorf("expected 1 node, found %d", len(foundNodes))
}
foundOne := false
foundTwo := false
//foundTwo := false
for _, n := range foundNodes {
if n.id.Equals(dhts[0].node.id) {
foundOne = true
}
if n.id.Equals(dhts[1].node.id) {
foundTwo = true
}
//if n.id.Equals(dhts[1].node.id) {
// foundTwo = true
//}
}
if !foundOne {
t.Errorf("did not find first node %s", dhts[0].node.id.Hex())
}
if !foundTwo {
t.Errorf("did not find second node %s", dhts[1].node.id.Hex())
}
//if !foundTwo {
// t.Errorf("did not find second node %s", dhts[1].node.id.Hex())
//}
}
func TestNodeFinder_FindValue(t *testing.T) {