mirror of
https://github.com/gonum/gonum.git
synced 2025-10-15 19:50:48 +08:00
Changed basic tests to use degree
This commit is contained in:
@@ -20,8 +20,8 @@ func TestBasicDenseImpassable(t *testing.T) {
|
||||
t.Errorf("Node that should exist doesn't: %d", i)
|
||||
}
|
||||
|
||||
if neighbors := dg.Neighbors(concrete.GonumNode(i)); len(neighbors) != 0 {
|
||||
t.Errorf("Node in impassable graph has a neighbor. Node: %d Neighbors: %v", i, neighbors)
|
||||
if degree := dg.Degree(concrete.GonumNode(i)); degree != 0 {
|
||||
t.Errorf("Node in impassable graph has a neighbor. Node: %d Degree: %d", i, degree)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ func TestBasicDensePassable(t *testing.T) {
|
||||
t.Errorf("Node that should exist doesn't: %d", i)
|
||||
}
|
||||
|
||||
if neighbors := dg.Neighbors(concrete.GonumNode(i)); len(neighbors) != 5 {
|
||||
t.Errorf("Node in passable graph doesn't have the right number of neighbors. Node: %d Neighbors: %v", i, neighbors)
|
||||
if degree := dg.Degree(concrete.GonumNode(i)); degree != 10 {
|
||||
t.Errorf("Node in impassable graph has a neighbor. Node: %d Degree: %d", i, degree)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,3 +54,5 @@ func TestBasicDensePassable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func
|
Reference in New Issue
Block a user