Skip to content

Commit

Permalink
(lineGraph/pgtap) fix for update test
Browse files Browse the repository at this point in the history
  • Loading branch information
cvvergara committed Aug 13, 2024
1 parent 0a3b989 commit 95d26cf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
11 changes: 7 additions & 4 deletions pgtap/lineGraph/lineGraph/edge_cases/edge_cases.pg
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ SELECT is_empty($$
SELECT lives_ok($$
SELECT * FROM pgr_lineGraph('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id = 17')
$$, '11-lives: one bi-edge directed');
SELECT set_eq($$
SELECT CASE WHEN min_version('3.7.0') THEN set_eq($$
SELECT * FROM pgr_lineGraph('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id = 17')
$$, $$VALUES (1,17,17,1,1)$$,
'12-non empty: one bi-edge directed');
'12-non empty: one bi-edge directed')
ELSE skip(1, 'pgr_lineGraph was fixed on 3.7.0') END;

SELECT lives_ok($$
SELECT * FROM pgr_lineGraph('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id = 17', false)
$$, '13-lives: one bi-edge undirected');
Expand Down Expand Up @@ -71,11 +73,12 @@ SELECT lives_ok($$
SELECT isnt_empty($$
SELECT * FROM pgr_lineGraph('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (6,7)')
$$, '5-not_empty: two bi-edge directed');
SELECT set_eq($$
SELECT CASE WHEN min_version('3.7.0') THEN set_eq($$
SELECT * FROM pgr_lineGraph('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (6,7)')
$$,
$$VALUES (1,6,6,1,1),(2,6,7,1,1),(3,7,7,1,1)$$,
'5-set_eq: two bi-edge directed');
'5-set_eq: two bi-edge directed')
ELSE skip(1, 'pgr_lineGraph was fixed on 3.7.0') END;

SELECT lives_ok($$
SELECT * FROM pgr_lineGraph('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (6,7)', false)
Expand Down
3 changes: 2 additions & 1 deletion pgtap/lineGraph/lineGraph/edge_cases/mathw_1.pg
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ FROM (VALUES
(8, 304, 204, 1, -1))
AS t(id, source, target, cost, reverse_cost);

SELECT set_eq('mathw_lg_1', 'expected_mathw_lg_1');
SELECT CASE WHEN min_version('3.7.0') THEN set_eq('mathw_lg_1', 'expected_mathw_lg_1', 'Expected Results')
ELSE skip(1, 'pgr_lineGraph was fixed on 3.7.0') END;

SELECT finish();
ROLLBACK;
6 changes: 4 additions & 2 deletions pgtap/lineGraph/lineGraph/edge_cases/mathw_2.pg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ FROM (VALUES
(9, 304, 304, 1, 1))
AS t(id, source, target, cost, reverse_cost);

SELECT set_eq('mathw_lg_2', 'expected_mathw_lg_2');
SELECT CASE WHEN min_version('3.7.0') THEN set_eq('mathw_lg_2', 'expected_mathw_lg_2', 'Expected Results')
ELSE skip(1, 'pgr_lineGraph was fixed on 3.7.0') END;

/* same example with expanded edges */
CREATE TABLE mathw_3 (
Expand Down Expand Up @@ -109,7 +110,8 @@ FROM (VALUES
(10, 403, 302, 1, -1))
AS t(id, source, target, cost, reverse_cost);

SELECT set_eq('mathw_lg_3', 'expected_mathw_lg_3');
SELECT CASE WHEN min_version('3.7.0') THEN set_eq('mathw_lg_3', 'expected_mathw_lg_3', 'Expected Results')
ELSE skip(1, 'pgr_lineGraph was fixed on 3.7.0') END;

SELECT finish();
ROLLBACK;
3 changes: 2 additions & 1 deletion pgtap/lineGraph/lineGraph/edge_cases/wiki_1.pg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ FROM (VALUES
(9, 405, 304, 1, -1))
AS t(id, source, target, cost, reverse_cost);

SELECT set_eq('wiki_lg_1', 'expected_wiki_lg_1');
SELECT CASE WHEN min_version('3.7.0') THEN set_eq('wiki_lg_1', 'expected_wiki_lg_1', 'Expected Results')
ELSE skip(1, 'pgr_lineGraph was fixed on 3.7.0') END;

SELECT finish();
ROLLBACK;

0 comments on commit 95d26cf

Please sign in to comment.