Skip to content

Commit f5914f9

Browse files
committed
(withPoints) (pgtap) Using function_types_(eq|has)
1 parent d7c6ded commit f5914f9

File tree

4 files changed

+36
-39
lines changed

4 files changed

+36
-39
lines changed

pgtap/withPoints/withPoints/types_check.pg

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,13 @@ WHEN min_version('3.2.0') THEN
6060
('{"","","","directed","driving_side","details","seq","path_seq","start_pid","end_pid","node","edge","cost","agg_cost"}'::TEXT[])
6161
$$),
6262

63-
set_eq(
64-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpoints'$$,
63+
function_types_eq('pgr_withpoints',
6564
$$VALUES
66-
('{25,25,20,20,16,1042,16,23,23,20,20,701,701}'::OID[]),
67-
('{25,25,20,2277,16,1042,16,23,23,20,20,20,701,701}'::OID[]),
68-
('{25,25,2277,20,16,1042,16,23,23,20,20,20,701,701}'::OID[]),
69-
('{25,25,2277,2277,16,1042,16,23,23,20,20,20,20,701,701}'::OID[]),
70-
('{25,25,25,16,1042,16,23,23,20,20,20,20,701,701}'::OID[])
65+
('{text,text,int8,int8,bool,bpchar,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
66+
('{text,text,anyarray,anyarray,bool,bpchar,bool,int4,int4,int8,int8,int8,int8,float8,float8}'),
67+
('{text,text,anyarray,int8,bool,bpchar,bool,int4,int4,int8,int8,int8,float8,float8}'),
68+
('{text,text,int8,anyarray,bool,bpchar,bool,int4,int4,int8,int8,int8,float8,float8}'),
69+
('{text,text,text,bool,bpchar,bool,int4,int4,int8,int8,int8,int8,float8,float8}')
7170
$$)
7271
)
7372
ELSE
@@ -81,13 +80,12 @@ ELSE
8180
('{"","","","","directed","driving_side","details","seq","path_seq","start_pid","end_pid","node","edge","cost","agg_cost"}'::TEXT[])
8281
$$),
8382

84-
set_eq(
85-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpoints'$$,
83+
function_types_eq('pgr_withpoints',
8684
$$VALUES
87-
('{25,25,20,20,16,1042,16,23,23,20,20,701,701}'::OID[]),
88-
('{25,25,20,2277,16,1042,16,23,23,20,20,20,701,701}'::OID[]),
89-
('{25,25,2277,20,16,1042,16,23,23,20,20,20,701,701}'::OID[]),
90-
('{25,25,2277,2277,16,1042,16,23,23,20,20,20,20,701,701}'::OID[])
85+
('{text,text,int8,int8,16,1042,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
86+
('{text,text,int8,anyarray,16,1042,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
87+
('{text,text,anyarray,int8,16,1042,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
88+
('{text,text,anyarray,anyarray,16,1042,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
9189
$$)
9290
)
9391
END;

pgtap/withPoints/withPointsCost/types_check.pg

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ WHEN min_version('3.2.0') THEN
6060
('{"","","","","directed","driving_side","start_pid","end_pid","agg_cost"}'::TEXT[]),
6161
('{"","","","directed","driving_side","start_pid","end_pid","agg_cost"}'::TEXT[])
6262
$$),
63-
set_eq(
64-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpointscost'$$,
63+
64+
function_types_eq('pgr_withpointscost',
6565
$$VALUES
66-
('{25,25,25,16,1042,20,20,701}'::OID[]),
67-
('{25,25,20,20,16,1042,20,20,701}'::OID[]),
68-
('{25,25,20,2277,16,1042,20,20,701}'::OID[]),
69-
('{25,25,2277,20,16,1042,20,20,701}'::OID[]),
70-
('{25,25,2277,2277,16,1042,20,20,701}'::OID[])
66+
('{text,text,text,bool,bpchar,int8,int8,float8}'::TEXT[]),
67+
('{text,text,int8,int8,bool,bpchar,int8,int8,float8}'::TEXT[]),
68+
('{text,text,int8,anyarray,bool,bpchar,int8,int8,float8}'::TEXT[]),
69+
('{text,text,anyarray,int8,bool,bpchar,int8,int8,float8}'::TEXT[]),
70+
('{text,text,anyarray,anyarray,bool,bpchar,int8,int8,float8}'::TEXT[])
7171
$$)
7272
)
7373
ELSE
@@ -80,13 +80,13 @@ ELSE
8080
('{"","","","","directed","driving_side","start_pid","end_pid","agg_cost"}'::TEXT[]),
8181
('{"","","","","directed","driving_side","start_pid","end_pid","agg_cost"}'::TEXT[])
8282
$$),
83-
set_eq(
84-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpointscost'$$,
83+
84+
function_types_eq('pgr_withpointscost',
8585
$$VALUES
86-
('{25,25,20,20,16,1042,20,20,701}'::OID[]),
87-
('{25,25,20,2277,16,1042,20,20,701}'::OID[]),
88-
('{25,25,2277,20,16,1042,20,20,701}'::OID[]),
89-
('{25,25,2277,2277,16,1042,20,20,701}'::OID[])
86+
('{text,text,int8,int8,bool,bpchar,int8,int8,float8}'::TEXT[]),
87+
('{text,text,int8,anyarray,bool,bpchar,int8,int8,float8}'::TEXT[]),
88+
('{text,text,anyarray,int8,bool,bpchar,int8,int8,float8}'::TEXT[]),
89+
('{text,text,anyarray,anyarray,bool,bpchar,int8,int8,float8}'::TEXT[])
9090
$$)
9191
)
9292
END;

pgtap/withPoints/withPointsCostMatrix/types_check.pg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ SELECT set_eq(
3131
('{"","","","directed","driving_side","start_vid","end_vid","agg_cost"}'::TEXT[])
3232
$$);
3333

34-
SELECT set_eq(
35-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpointscostmatrix'$$,
34+
SELECT function_types_eq('pgr_withpointscostmatrix',
3635
$$VALUES
37-
('{25,25,2277,16,1042,20,20,701}'::OID[])
36+
('{text,text,anyarray,bool,bpchar,int8,int8,float8}'::TEXT[])
3837
$$);
3938

4039
SELECT finish();

pgtap/withPoints/withPointsDD/types_check.pg

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ THEN collect_tap (
5454
('{"","","","","directed","driving_side","details","seq","node","edge","cost","agg_cost"}'::TEXT[]),
5555
('{"","","","","directed","driving_side","details","equicost","seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[])
5656
$$),
57-
set_eq(
58-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpointsdd'$$,
57+
58+
function_types_eq('pgr_withpointsdd',
5959
$$VALUES
60-
('{25,25,20,701,1042,16,16,20,20,20,20,20,20,701,701}'::OID[]),
61-
('{25,25,2277,701,1042,16,16,16,20,20,20,20,20,20,701,701}'::OID[]),
62-
('{25,25,20,701,16,1042,16,23,20,20,701,701}'::OID[]),
63-
('{25,25,2277,701,16,1042,16,16,23,20,20,20,701,701}'::OID[])
60+
('{text,text,anyarray,float8,bpchar,bool,bool,bool,int8,int8,int8,int8,int8,int8,float8,float8}'::TEXT[]),
61+
('{text,text,int8,float8,bpchar,bool,bool,int8,int8,int8,int8,int8,int8,float8,float8}'::TEXT[]),
62+
('{text,text,int8,float8,bool,bpchar,bool,int4,int8,int8,float8,float8}'::TEXT[]),
63+
('{text,text,anyarray,float8,bool,bpchar,bool,bool,int4,int8,int8,int8,float8,float8}'::TEXT[])
6464
$$)
6565
)
6666
ELSE collect_tap(
@@ -70,11 +70,11 @@ ELSE collect_tap(
7070
('{"","","","","directed","driving_side","details","seq","node","edge","cost","agg_cost"}'::TEXT[]),
7171
('{"","","","","directed","driving_side","details","equicost","seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[])
7272
$$),
73-
set_eq(
74-
$$SELECT proallargtypes from pg_proc where proname = 'pgr_withpointsdd'$$,
73+
74+
function_types_eq('pgr_withpointsdd',
7575
$$VALUES
76-
('{25,25,20,701,16,1042,16,23,20,20,701,701}'::OID[]),
77-
('{25,25,2277,701,16,1042,16,16,23,20,20,20,701,701}'::OID[])
76+
('{text,text,anyarray,float8,bool,bpchar,bool,bool,int4,int8,int8,int8,float8,float8}'::TEXT[]),
77+
('{text,text,int8,float8,bool,bpchar,bool,int4,int8,int8,float8,float8}')
7878
$$)
7979
)
8080
END;

0 commit comments

Comments
 (0)