Skip to content

Commit ee7ff37

Browse files
committed
(test) fixing for update test
1 parent a18d2f7 commit ee7ff37

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

pgtap/traversal/depthFirstSearch/edge_cases/copmare_BFS.pg

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2121
BEGIN;
2222

2323
UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
24-
SELECT CASE WHEN min_version('4.0.0') THEN plan (17) ELSE plan(17) END;
24+
SELECT CASE WHEN min_version('3.2.0') THEN plan (17) ELSE plan(1) END;
2525

2626
CREATE OR REPLACE FUNCTION edge_cases()
2727
RETURNS SETOF TEXT AS
2828
$BODY$
2929
BEGIN
3030

31+
IF NOT min_version('3.2.0') THEN
32+
RETURN QUERY
33+
SELECT skip(1, 'pgr_depthFirstSearch: Function is new on 3.2.0');
34+
RETURN;
35+
END IF;
36+
3137
PREPARE sample_data AS
3238
SELECT id, source, target, cost, reverse_cost
3339
FROM edges;

pgtap/traversal/depthFirstSearch/edge_cases/directed.pg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ SELECT seq,depth,start_vid,node,edge,cost,agg_cost
9090
FROM pgr_depthFirstSearch('q3', 4, max_depth => -3);
9191

9292
RETURN QUERY
93-
SELECT
93+
SELECT
9494
CASE WHEN min_version('4.0.0') THEN
9595
throws_ok('depthFirstSearch5',
9696
'XX000', 'Negative value found on ''max_depth''',
@@ -260,7 +260,7 @@ SELECT set_eq('depthFirstSearch14',
260260
PREPARE q15 AS
261261
SELECT id, source, target, cost, reverse_cost
262262
FROM edges
263-
WHERE id IN (8,10,11,12);
263+
WHERE id IN (8,10,11,12) ORDER BY id;
264264

265265
RETURN QUERY
266266
SELECT set_eq('q15',

pgtap/traversal/depthFirstSearch/edge_cases/undirected.pg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ SELECT set_eq('depthFirstSearch14',
264264
PREPARE q15 AS
265265
SELECT id, source, target, cost, reverse_cost
266266
FROM edges
267-
WHERE id IN (8,10,11,12);
267+
WHERE id IN (8,10,11,12) ORDER BY id;
268268

269269
RETURN QUERY
270270
SELECT set_eq('q15',
@@ -289,8 +289,6 @@ PREPARE depthFirstSearch18 AS
289289
SELECT seq,depth,start_vid,node,edge,cost,agg_cost
290290
FROM pgr_depthFirstSearch( 'q15', ARRAY[7, 8, 11, 12], directed => false, max_depth => 2);
291291

292-
PERFORM todo_start('sometimes this tests fails');
293-
294292
RETURN QUERY
295293
SELECT set_eq('depthFirstSearch16',
296294
$$VALUES
@@ -356,7 +354,6 @@ SELECT set_eq('depthFirstSearch18',
356354
'18: 4 vertices tests'
357355
);
358356

359-
PERFORM todo_end();
360357
END;
361358
$BODY$
362359
LANGUAGE plpgsql;

sql/scripts/build-extension-update-files.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,17 @@ sub generate_upgrade_script {
278278
push @commands, drop_special_case_function("pgr_dagshortestpath(text,text)");
279279
push @commands, drop_special_case_function("pgr_sequentialvertexcoloring(text)");
280280
push @commands, drop_special_case_function("pgr_bipartite(text)");
281+
282+
push @commands, drop_special_case_function("_pgr_depthfirstsearch(text,anyarray,boolean,bigint)");
283+
push @commands, drop_special_case_function("pgr_depthfirstsearch(text,anyarray,boolean,bigint)");
284+
push @commands, drop_special_case_function("pgr_depthfirstsearch(text,bigint,boolean,bigint)");
281285
}
282286

283287
if ($old_minor >= "3.3") {
284288
push @commands, drop_special_case_function("pgr_edgecoloring(text)");
285289
}
286290

287291
push @commands, drop_special_case_function("_pgr_breadthfirstsearch(text,anyarray,bigint,boolean)");
288-
push @commands, drop_special_case_function("_pgr_depthfirstsearch(text,anyarray,boolean,bigint)");
289292

290293
# Row type defined by OUT parameters is different.
291294
# Out parameters changed names on v4.0.0
@@ -304,9 +307,6 @@ sub generate_upgrade_script {
304307
push @commands, drop_special_case_function("pgr_dagshortestpath(text,anyarray,bigint)");
305308
push @commands, drop_special_case_function("pgr_dagshortestpath(text,anyarray,anyarray)");
306309

307-
push @commands, drop_special_case_function("pgr_depthfirstsearch(text,anyarray,boolean,bigint)");
308-
push @commands, drop_special_case_function("pgr_depthfirstsearch(text,bigint,boolean,bigint)");
309-
310310
push @commands, drop_special_case_function("pgr_edwardmoore(text,bigint,bigint,boolean)");
311311
push @commands, drop_special_case_function("pgr_edwardmoore(text,anyarray,bigint,boolean)");
312312
push @commands, drop_special_case_function("pgr_edwardmoore(text,bigint,anyarray,boolean)");

0 commit comments

Comments
 (0)