From 4b88960c14f5aa03b23cc413595b2190738ba6c1 Mon Sep 17 00:00:00 2001 From: Michael Young Date: Wed, 12 Jun 2024 12:12:59 +0100 Subject: [PATCH] Add edge cases to tests --- tst/standard/weights.tst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tst/standard/weights.tst b/tst/standard/weights.tst index d38b346f3..9e5d2abdf 100644 --- a/tst/standard/weights.tst +++ b/tst/standard/weights.tst @@ -245,6 +245,11 @@ Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 1st choice method found for `EdgeWeightedDigraphShortestPaths' on 2 \ arguments +# Shortest path: same vertex +gap> d := EdgeWeightedDigraph([[2], [3], [1]], [[-3], [-5], [-7]]);; +gap> EdgeWeightedDigraphShortestPath(d, 2, 2); +fail + # Shortest paths: Johnson gap> d := EdgeWeightedDigraph([[2], [3], [], [], []], [[3], [5], [], [], []]); @@ -261,6 +266,9 @@ rec( distances := [ [ 0, 3, 8, fail, fail ], [ fail, 0, 5, fail, fail ], parents := [ [ fail, 1, 2, fail, fail ], [ fail, fail, 2, fail, fail ], [ fail, fail, fail, fail, fail ], [ fail, fail, fail, fail, fail ], [ fail, fail, fail, fail, fail ] ] ) +gap> EdgeWeightedDigraphShortestPaths(d, 6); +Error, the 2nd argument must be a vertex of the digraph tha\ +t is the 1st argument, gap> EdgeWeightedDigraphShortestPath(d, 1, 3); [ [ 1, 2, 3 ], [ 1, 1 ] ]