@@ -19,73 +19,56 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1919 ********************************************************************PGR-GNU*/
2020BEGIN;
2121
22- SELECT plan(13);
22+ SELECT CASE WHEN min_version('4.0.0') THEN plan(13) ELSE plan(12) END ;
2323
24- SELECT has_function('pgr_edgedisjointpaths');
24+ CREATE or REPLACE FUNCTION types_check()
25+ RETURNS SETOF TEXT AS
26+ $BODY$
27+ BEGIN
2528
29+ RETURN QUERY SELECT has_function('pgr_edgedisjointpaths');
2630
27- SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','bigint','bigint','boolean']);
28- SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','bigint','anyarray','boolean']);
29- SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','anyarray','bigint','boolean']);
30- SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','anyarray','anyarray','boolean']);
31+ RETURN QUERY SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','bigint','bigint','boolean']);
32+ RETURN QUERY SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','bigint','anyarray','boolean']);
33+ RETURN QUERY SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','anyarray','bigint','boolean']);
34+ RETURN QUERY SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','anyarray','anyarray','boolean']);
3135
32- SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','bigint','bigint','boolean'],'setof record');
33- SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','bigint','anyarray','boolean'],'setof record');
34- SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','anyarray','bigint','boolean'],'setof record');
35- SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','anyarray','anyarray','boolean'],'setof record');
36+ RETURN QUERY SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','bigint','bigint','boolean'],'setof record');
37+ RETURN QUERY SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','bigint','anyarray','boolean'],'setof record');
38+ RETURN QUERY SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','anyarray','bigint','boolean'],'setof record');
39+ RETURN QUERY SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','anyarray','anyarray','boolean'],'setof record');
3640
37- SELECT CASE
38- WHEN min_version('3.2.0') THEN
39- collect_tap(
40- has_function('pgr_edgedisjointpaths', ARRAY['text','text','boolean']),
41- function_returns('pgr_edgedisjointpaths', ARRAY['text','text','boolean'],'setof record')
42- )
43- ELSE
44- skip(2, 'Combinations signature added on 3.2.0')
45- END;
46-
47- SELECT CASE
48- WHEN min_version('3.2.0') THEN
49- collect_tap(
41+ IF min_version('3.2.0') THEN
42+ RETURN QUERY SELECT has_function('pgr_edgedisjointpaths', ARRAY['text','text','boolean']);
43+ RETURN QUERY SELECT function_returns('pgr_edgedisjointpaths', ARRAY['text','text','boolean'],'setof record');
44+ ELSE
45+ RETURN QUERY SELECT skip(2, 'Combinations signature added on 3.2.0');
46+ END IF;
5047
51- function_args_eq('pgr_edgedisjointpaths',
52- $$VALUES
53- ('{"","","","directed","seq","path_id","path_seq","node","edge","cost","agg_cost"}'::TEXT[]),
54- ('{"","","","directed","seq","path_id","path_seq","end_vid","node","edge","cost","agg_cost"}'::TEXT[]),
55- ('{"","","","directed","seq","path_id","path_seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[]),
56- ('{"","","","directed","seq","path_id","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]),
57- ('{"","","directed","seq","path_id","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[])
58- $$),
48+ IF NOT min_version('4.0.0') THEN
49+ RETURN QUERY SELECT skip(1, 'pgr_edgedisjointpaths: testing only signatures standardaized in v4.0.0.');
50+ RETURN;
51+ END IF;
5952
60- function_types_eq('pgr_edgedisjointpaths',
61- $$VALUES
62- ('{text,int8,int8,bool,int4,int4,int4,int8,int8,float8,float8}'::TEXT[]),
63- ('{text,int8,anyarray,bool,int4,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
64- ('{text,anyarray,int8,bool,int4,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
65- ('{text,anyarray,anyarray,bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
66- ('{text,text,bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
67- $$)
68- )
69- ELSE
70- collect_tap(
53+ RETURN QUERY SELECT function_args_eq('pgr_edgedisjointpaths',
54+ $$VALUES
55+ ('{"","","",directed,seq,path_id,path_seq,start_vid,end_vid,node,edge,cost,agg_cost}'::TEXT[]),
56+ ('{"","", directed,seq,path_id,path_seq,start_vid,end_vid,node,edge,cost,agg_cost}'::TEXT[])
57+ $$);
7158
72- function_args_eq('pgr_edgedisjointpaths',
73- $$VALUES
74- ('{"","","","directed","seq","path_id","path_seq","node","edge","cost","agg_cost"}'::TEXT[]),
75- ('{"","","","directed","seq","path_id","path_seq","end_vid","node","edge","cost","agg_cost"}'::TEXT[]),
76- ('{"","","","directed","seq","path_id","path_seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[]),
77- ('{"","","","directed","seq","path_id","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[])
78- $$),
79-
80- function_types_eq('pgr_edgedisjointpaths',
81- $$VALUES
82- ('{text,int8,int8,bool,int4,int4,int4,int8,int8,float8,float8}'::TEXT[]),
83- ('{text,int8,anyarray,bool,int4,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
84- ('{text,anyarray,int8,bool,int4,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
59+ RETURN QUERY SELECT function_types_eq('pgr_edgedisjointpaths',
60+ $$VALUES
61+ ('{text,text, bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
62+ ('{text,int8,int8, bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
63+ ('{text,int8,anyarray, bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
64+ ('{text,anyarray,int8, bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
8565 ('{text,anyarray,anyarray,bool,int4,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
86- $$)
87- )
66+ $$);
67+
8868END;
69+ $BODY$
70+ language plpgsql;
8971
72+ SELECT types_check();
9073SELECT finish();
9174ROLLBACK;
0 commit comments