@@ -10,7 +10,7 @@ def test_topological_sort():
1010 g .addEdge (2 , 3 )
1111 g .addEdge (3 , 1 )
1212
13- assert g .topologicalSort () == [5 , 4 , 2 , 3 , 1 , 0 ]
13+ assert g .topologicalSort ()[ 0 ] == [5 , 4 , 2 , 3 , 1 , 0 ]
1414
1515
1616def test_topological_sort_2 ():
@@ -20,15 +20,15 @@ def test_topological_sort_2():
2020 for j in range (i + 1 , 10 ):
2121 g .addEdge (i , j )
2222
23- assert g .topologicalSort () == [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
23+ assert g .topologicalSort ()[ 0 ] == [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
2424
2525 g = Graph (10 )
2626
2727 for i in range (10 ):
2828 for j in range (i + 1 , 10 ):
2929 g .addEdge (i , j )
3030
31- assert g .topologicalSort () == [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
31+ assert g .topologicalSort ()[ 0 ] == [0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
3232
3333
3434def test_topological_sort_3 ():
@@ -38,4 +38,4 @@ def test_topological_sort_3():
3838 for j in range (i + 1 , 1000 ):
3939 g .addEdge (j , i )
4040
41- assert g .topologicalSort () == list (reversed (range (1000 )))
41+ assert g .topologicalSort ()[ 0 ] == list (reversed (range (1000 )))
0 commit comments