Skip to content

Commit 96103f8

Browse files
mtorpeymarkuspf
authored andcommitted
Add edge cases to tests
1 parent 3621098 commit 96103f8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tst/standard/weights.tst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ Error, no method found! For debugging hints type ?Recovery from NoMethodFound
245245
Error, no 1st choice method found for `EdgeWeightedDigraphShortestPaths' on 2 \
246246
arguments
247247
248+
# Shortest path: same vertex
249+
gap> d := EdgeWeightedDigraph([[2], [3], [1]], [[-3], [-5], [-7]]);;
250+
gap> EdgeWeightedDigraphShortestPath(d, 2, 2);
251+
fail
252+
248253
# Shortest paths: Johnson
249254
gap> d := EdgeWeightedDigraph([[2], [3], [], [], []], [[3], [5], [], [], []]);
250255
<immutable digraph with 5 vertices, 2 edges>
@@ -261,6 +266,9 @@ rec( distances := [ [ 0, 3, 8, fail, fail ], [ fail, 0, 5, fail, fail ],
261266
parents := [ [ fail, 1, 2, fail, fail ], [ fail, fail, 2, fail, fail ],
262267
[ fail, fail, fail, fail, fail ], [ fail, fail, fail, fail, fail ],
263268
[ fail, fail, fail, fail, fail ] ] )
269+
gap> EdgeWeightedDigraphShortestPaths(d, 6);
270+
Error, the 2nd argument <source> must be a vertex of the digraph <digraph> tha\
271+
t is the 1st argument,
264272
gap> EdgeWeightedDigraphShortestPath(d, 1, 3);
265273
[ [ 1, 2, 3 ], [ 1, 1 ] ]
266274

0 commit comments

Comments
 (0)