You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pgtap/traversal/binaryBreadthFirstSearch/edge_cases/edge_cases.pg
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -80,10 +80,18 @@ FROM pgr_binaryBreadthFirstSearch(
80
80
);
81
81
82
82
83
-
SELECT throws_ok('errorTestManyWeights',
83
+
SELECT
84
+
CASE WHEN min_lib_version('4.0.0') THEN
85
+
throws_ok('errorTestManyWeights',
84
86
'XX000',
85
87
'Graph Condition Failed: Graph should have at most two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!',
86
-
'17: Graph has more than 2 distinct weights');
88
+
'17: Graph has more than 2 distinct weights')
89
+
ELSE
90
+
throws_ok('errorTestManyWeights',
91
+
'XX000',
92
+
'Graph Condition Failed: Graph should have atmost two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!',
93
+
'17: Graph has more than 2 distinct weights')
94
+
END;
87
95
88
96
SELECT * INTO edges_invalid_2 FROM edges;
89
97
UPDATE edges_invalid_2 SET cost = 2 WHERE cost = 0;
@@ -98,10 +106,18 @@ FROM pgr_binaryBreadthFirstSearch(
98
106
);
99
107
100
108
101
-
SELECT throws_ok('errorTestNoZeroWeight',
109
+
SELECT
110
+
CASE WHEN min_lib_version('4.0.0') THEN
111
+
throws_ok('errorTestNoZeroWeight',
102
112
'XX000',
103
113
'Graph Condition Failed: Graph should have at most two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!',
104
-
'17: If graph has 2 distinct weights, one must be zero');
114
+
'17: If graph has 2 distinct weights, one must be zero')
115
+
ELSE
116
+
throws_ok('errorTestNoZeroWeight',
117
+
'XX000',
118
+
'Graph Condition Failed: Graph should have atmost two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!',
119
+
'17: If graph has 2 distinct weights, one must be zero')
0 commit comments