From 95d26cf8ede47041648adde8e5c6ee31ad75f900 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 12 Aug 2024 17:12:27 -0600 Subject: [PATCH] (lineGraph/pgtap) fix for update test --- pgtap/lineGraph/lineGraph/edge_cases/edge_cases.pg | 11 +++++++---- pgtap/lineGraph/lineGraph/edge_cases/mathw_1.pg | 3 ++- pgtap/lineGraph/lineGraph/edge_cases/mathw_2.pg | 6 ++++-- pgtap/lineGraph/lineGraph/edge_cases/wiki_1.pg | 3 ++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pgtap/lineGraph/lineGraph/edge_cases/edge_cases.pg b/pgtap/lineGraph/lineGraph/edge_cases/edge_cases.pg index f373240800..81a9e332c6 100644 --- a/pgtap/lineGraph/lineGraph/edge_cases/edge_cases.pg +++ b/pgtap/lineGraph/lineGraph/edge_cases/edge_cases.pg @@ -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'); @@ -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) diff --git a/pgtap/lineGraph/lineGraph/edge_cases/mathw_1.pg b/pgtap/lineGraph/lineGraph/edge_cases/mathw_1.pg index 3cbabc000c..b12d827534 100644 --- a/pgtap/lineGraph/lineGraph/edge_cases/mathw_1.pg +++ b/pgtap/lineGraph/lineGraph/edge_cases/mathw_1.pg @@ -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; diff --git a/pgtap/lineGraph/lineGraph/edge_cases/mathw_2.pg b/pgtap/lineGraph/lineGraph/edge_cases/mathw_2.pg index 70c0f26ecf..f21dbdbd7d 100644 --- a/pgtap/lineGraph/lineGraph/edge_cases/mathw_2.pg +++ b/pgtap/lineGraph/lineGraph/edge_cases/mathw_2.pg @@ -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 ( @@ -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; diff --git a/pgtap/lineGraph/lineGraph/edge_cases/wiki_1.pg b/pgtap/lineGraph/lineGraph/edge_cases/wiki_1.pg index 853afb275a..eebaaf95b0 100644 --- a/pgtap/lineGraph/lineGraph/edge_cases/wiki_1.pg +++ b/pgtap/lineGraph/lineGraph/edge_cases/wiki_1.pg @@ -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;