Skip to content

Commit

Permalink
test: update findAllcycles tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kiarash8112 committed Oct 25, 2023
1 parent fb7e6dd commit 4163638
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions graph/cycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,17 @@ func TestFindAllCycles(t *testing.T) {
t.Error("number of cycles is not correct")
}

firstCycle := res[0]
if len(firstCycle.edges) != 3 {
t.Error("number of vertex in cycle is not correct")
}
if _, ok := firstCycle.edges[3][4]; !ok {
t.Error("connection in cycle is not correct")
}
if _, ok := firstCycle.edges[4][7]; !ok {
t.Error("connection in cycle is not correct")
}
if _, ok := firstCycle.edges[7][3]; !ok {
t.Error("connection in cycle is not correct")
}
}

0 comments on commit 4163638

Please sign in to comment.