Skip to content

Commit 7f2e246

Browse files
Updated comments from colum[] to columns[]
1 parent aa746ce commit 7f2e246

9 files changed

Lines changed: 92 additions & 92 deletions

File tree

Changes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Revision history for pgTAP
77
has upgraded its Markdown parser.
88
* Added an example of an empty array, `'{}'::name[]`, to each mention in the
99
documentation. Thanks Kevin Brannen for the suggestion (#362).
10-
* Added missing `schema, table, column[]` and `schema, table, column` variants
10+
* Added missing `schema, table, columns[]` and `schema, table, column` variants
1111
of `col_isnt_pk()`, `col_is_fk()`, and `col_isnt_fk()`, and established a
1212
consistent overload order for `col_is_pk()`, `col_isnt_pk()`, `col_is_fk()`,
1313
`col_isnt_fk()`, and `col_is_unique()`.

sql/pgtap--1.3.4--1.3.5.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- Changes between pgTAP v1.3.4 and v1.3.5.
22

3-
-- col_isnt_pk( schema, table, column[] )
3+
-- col_isnt_pk( schema, table, columns[] )
44
CREATE OR REPLACE FUNCTION col_isnt_pk ( NAME, NAME, NAME[] )
55
RETURNS TEXT AS $$
66
SELECT col_isnt_pk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should not be a primary key' );
@@ -12,7 +12,7 @@ RETURNS TEXT AS $$
1212
SELECT col_isnt_pk( $1, $2, $3, 'Column ' || quote_ident($1) || '.' || quote_ident($2) || '(' || quote_ident($3) || ') should not be a primary key' );
1313
$$ LANGUAGE sql;
1414

15-
-- col_is_fk( schema, table, column[] )
15+
-- col_is_fk( schema, table, columns[] )
1616
CREATE OR REPLACE FUNCTION col_is_fk ( NAME, NAME, NAME[] )
1717
RETURNS TEXT AS $$
1818
SELECT col_is_fk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should be a foreign key' );
@@ -24,7 +24,7 @@ RETURNS TEXT AS $$
2424
SELECT col_is_fk( $1, $2, $3, 'Column ' || quote_ident($1) || '.' || quote_ident($2) || '(' || quote_ident($3) || ') should be a foreign key' );
2525
$$ LANGUAGE sql;
2626

27-
-- col_isnt_fk( schema, table, column[] )
27+
-- col_isnt_fk( schema, table, columns[] )
2828
CREATE OR REPLACE FUNCTION col_isnt_fk ( NAME, NAME, NAME[] )
2929
RETURNS TEXT AS $$
3030
SELECT col_isnt_fk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should not be a foreign key' );

sql/pgtap.sql.in

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,25 +2050,25 @@ RETURNS NAME[] AS $$
20502050
SELECT * FROM _keys($1, $2) LIMIT 1;
20512051
$$ LANGUAGE sql;
20522052

2053-
-- col_is_pk( schema, table, column[], description )
2053+
-- col_is_pk( schema, table, columns[], description )
20542054
CREATE OR REPLACE FUNCTION col_is_pk ( NAME, NAME, NAME[], TEXT )
20552055
RETURNS TEXT AS $$
20562056
SELECT is( _ckeys( $1, $2, 'p' ), $3, $4 );
20572057
$$ LANGUAGE sql;
20582058

2059-
-- col_is_pk( schema, table, column[] )
2059+
-- col_is_pk( schema, table, columns[] )
20602060
CREATE OR REPLACE FUNCTION col_is_pk ( NAME, NAME, NAME[] )
20612061
RETURNS TEXT AS $$
20622062
SELECT col_is_pk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should be a primary key' );
20632063
$$ LANGUAGE sql;
20642064

2065-
-- col_is_pk( table, column[], description )
2065+
-- col_is_pk( table, columns[], description )
20662066
CREATE OR REPLACE FUNCTION col_is_pk ( NAME, NAME[], TEXT )
20672067
RETURNS TEXT AS $$
20682068
SELECT is( _ckeys( $1, 'p' ), $2, $3 );
20692069
$$ LANGUAGE sql;
20702070

2071-
-- col_is_pk( table, column[] )
2071+
-- col_is_pk( table, columns[] )
20722072
CREATE OR REPLACE FUNCTION col_is_pk ( NAME, NAME[] )
20732073
RETURNS TEXT AS $$
20742074
SELECT col_is_pk( $1, $2, 'Columns ' || quote_ident($1) || '(' || _ident_array_to_string($2, ', ') || ') should be a primary key' );
@@ -2098,25 +2098,25 @@ RETURNS TEXT AS $$
20982098
SELECT col_is_pk( $1, $2, 'Column ' || quote_ident($1) || '(' || quote_ident($2) || ') should be a primary key' );
20992099
$$ LANGUAGE sql;
21002100

2101-
-- col_isnt_pk( schema, table, column[], description )
2101+
-- col_isnt_pk( schema, table, columns[], description )
21022102
CREATE OR REPLACE FUNCTION col_isnt_pk ( NAME, NAME, NAME[], TEXT )
21032103
RETURNS TEXT AS $$
21042104
SELECT isnt( _ckeys( $1, $2, 'p' ), $3, $4 );
21052105
$$ LANGUAGE sql;
21062106

2107-
-- col_isnt_pk( schema, table, column[] )
2107+
-- col_isnt_pk( schema, table, columns[] )
21082108
CREATE OR REPLACE FUNCTION col_isnt_pk ( NAME, NAME, NAME[] )
21092109
RETURNS TEXT AS $$
21102110
SELECT col_isnt_pk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should not be a primary key' );
21112111
$$ LANGUAGE sql;
21122112

2113-
-- col_isnt_pk( table, column[], description )
2113+
-- col_isnt_pk( table, columns[], description )
21142114
CREATE OR REPLACE FUNCTION col_isnt_pk ( NAME, NAME[], TEXT )
21152115
RETURNS TEXT AS $$
21162116
SELECT isnt( _ckeys( $1, 'p' ), $2, $3 );
21172117
$$ LANGUAGE sql;
21182118

2119-
-- col_isnt_pk( table, column[] )
2119+
-- col_isnt_pk( table, columns[] )
21202120
CREATE OR REPLACE FUNCTION col_isnt_pk ( NAME, NAME[] )
21212121
RETURNS TEXT AS $$
21222122
SELECT col_isnt_pk( $1, $2, 'Columns ' || quote_ident($1) || '(' || _ident_array_to_string($2, ', ') || ') should not be a primary key' );
@@ -2204,7 +2204,7 @@ RETURNS BOOLEAN AS $$
22042204
);
22052205
$$ LANGUAGE SQL;
22062206

2207-
-- col_is_fk( schema, table, column[], description )
2207+
-- col_is_fk( schema, table, columns[], description )
22082208
CREATE OR REPLACE FUNCTION col_is_fk ( NAME, NAME, NAME[], TEXT )
22092209
RETURNS TEXT AS $$
22102210
DECLARE
@@ -2237,13 +2237,13 @@ BEGIN
22372237
END;
22382238
$$ LANGUAGE plpgsql;
22392239

2240-
-- col_is_fk( schema, table, column[] )
2240+
-- col_is_fk( schema, table, columns[] )
22412241
CREATE OR REPLACE FUNCTION col_is_fk ( NAME, NAME, NAME[] )
22422242
RETURNS TEXT AS $$
22432243
SELECT col_is_fk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should be a foreign key' );
22442244
$$ LANGUAGE sql;
22452245

2246-
-- col_is_fk( table, column[], description )
2246+
-- col_is_fk( table, columns[], description )
22472247
CREATE OR REPLACE FUNCTION col_is_fk ( NAME, NAME[], TEXT )
22482248
RETURNS TEXT AS $$
22492249
DECLARE
@@ -2275,7 +2275,7 @@ BEGIN
22752275
END;
22762276
$$ LANGUAGE plpgsql;
22772277

2278-
-- col_is_fk( table, column[] )
2278+
-- col_is_fk( table, columns[] )
22792279
CREATE OR REPLACE FUNCTION col_is_fk ( NAME, NAME[] )
22802280
RETURNS TEXT AS $$
22812281
SELECT col_is_fk( $1, $2, 'Columns ' || quote_ident($1) || '(' || _ident_array_to_string($2, ', ') || ') should be a foreign key' );
@@ -2305,25 +2305,25 @@ RETURNS TEXT AS $$
23052305
SELECT col_is_fk( $1, $2, 'Column ' || quote_ident($1) || '(' || quote_ident($2) || ') should be a foreign key' );
23062306
$$ LANGUAGE sql;
23072307

2308-
-- col_isnt_fk( schema, table, column[], description )
2308+
-- col_isnt_fk( schema, table, columns[], description )
23092309
CREATE OR REPLACE FUNCTION col_isnt_fk ( NAME, NAME, NAME[], TEXT )
23102310
RETURNS TEXT AS $$
23112311
SELECT ok( NOT _fkexists( $1, $2, $3 ), $4 );
23122312
$$ LANGUAGE SQL;
23132313

2314-
-- col_isnt_fk( schema, table, column[] )
2314+
-- col_isnt_fk( schema, table, columns[] )
23152315
CREATE OR REPLACE FUNCTION col_isnt_fk ( NAME, NAME, NAME[] )
23162316
RETURNS TEXT AS $$
23172317
SELECT col_isnt_fk( $1, $2, $3, 'Columns ' || quote_ident($1) || '.' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should not be a foreign key' );
23182318
$$ LANGUAGE sql;
23192319

2320-
-- col_isnt_fk( table, column[], description )
2320+
-- col_isnt_fk( table, columns[], description )
23212321
CREATE OR REPLACE FUNCTION col_isnt_fk ( NAME, NAME[], TEXT )
23222322
RETURNS TEXT AS $$
23232323
SELECT ok( NOT _fkexists( $1, $2 ), $3 );
23242324
$$ LANGUAGE SQL;
23252325

2326-
-- col_isnt_fk( table, column[] )
2326+
-- col_isnt_fk( table, columns[] )
23272327
CREATE OR REPLACE FUNCTION col_isnt_fk ( NAME, NAME[] )
23282328
RETURNS TEXT AS $$
23292329
SELECT col_isnt_fk( $1, $2, 'Columns ' || quote_ident($1) || '(' || _ident_array_to_string($2, ', ') || ') should not be a foreign key' );
@@ -2419,25 +2419,25 @@ BEGIN
24192419
END;
24202420
$$ LANGUAGE plpgsql;
24212421

2422-
-- col_is_unique( schema, table, column[], description )
2422+
-- col_is_unique( schema, table, columns[], description )
24232423
CREATE OR REPLACE FUNCTION col_is_unique ( NAME, NAME, NAME[], TEXT )
24242424
RETURNS TEXT AS $$
24252425
SELECT _constraint( $1, $2, 'u', $3, $4, 'unique' );
24262426
$$ LANGUAGE sql;
24272427

2428-
-- col_is_unique( schema, table, column[] )
2428+
-- col_is_unique( schema, table, columns[] )
24292429
CREATE OR REPLACE FUNCTION col_is_unique ( NAME, NAME, NAME[] )
24302430
RETURNS TEXT AS $$
24312431
SELECT col_is_unique( $1, $2, $3, 'Columns ' || quote_ident($2) || '(' || _ident_array_to_string($3, ', ') || ') should have a unique constraint' );
24322432
$$ LANGUAGE sql;
24332433

2434-
-- col_is_unique( table, column[], description )
2434+
-- col_is_unique( table, columns[], description )
24352435
CREATE OR REPLACE FUNCTION col_is_unique ( NAME, NAME[], TEXT )
24362436
RETURNS TEXT AS $$
24372437
SELECT _constraint( $1, 'u', $2, $3, 'unique' );
24382438
$$ LANGUAGE sql;
24392439

2440-
-- col_is_unique( table, column[] )
2440+
-- col_is_unique( table, columns[] )
24412441
CREATE OR REPLACE FUNCTION col_is_unique ( NAME, NAME[] )
24422442
RETURNS TEXT AS $$
24432443
SELECT col_is_unique( $1, $2, 'Columns ' || quote_ident($1) || '(' || _ident_array_to_string($2, ', ') || ') should have a unique constraint' );

test/expected/fktap.out

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ ok 43 - col_is_fk with no FKs should have the proper diagnostics
4646
ok 44 - col_is_fk with no FKs should fail
4747
ok 45 - col_is_fk with no FKs should have the proper description
4848
ok 46 - col_is_fk with no FKs should have the proper diagnostics
49-
ok 47 - col_is_fk( schema, table, column[], description ) should pass
50-
ok 48 - col_is_fk( schema, table, column[], description ) should have the proper description
51-
ok 49 - col_is_fk( schema, table, column[] ) should pass
52-
ok 50 - col_is_fk( schema, table, column[] ) should have the proper description
53-
ok 51 - col_is_fk( table, column[], description ) should pass
54-
ok 52 - col_is_fk( table, column[], description ) should have the proper description
55-
ok 53 - col_is_fk( table, column[] ) should pass
56-
ok 54 - col_is_fk( table, column[] ) should have the proper description
49+
ok 47 - col_is_fk( schema, table, columns[], description ) should pass
50+
ok 48 - col_is_fk( schema, table, columns[], description ) should have the proper description
51+
ok 49 - col_is_fk( schema, table, columns[] ) should pass
52+
ok 50 - col_is_fk( schema, table, columns[] ) should have the proper description
53+
ok 51 - col_is_fk( table, columns[], description ) should pass
54+
ok 52 - col_is_fk( table, columns[], description ) should have the proper description
55+
ok 53 - col_is_fk( table, columns[] ) should pass
56+
ok 54 - col_is_fk( table, columns[] ) should have the proper description
5757
ok 55 - col_isnt_fk( schema, table, column, description ) should fail
5858
ok 56 - col_isnt_fk( schema, table, column, description ) should have the proper description
5959
ok 57 - col_isnt_fk( schema, table, column, description ) should have the proper diagnostics
@@ -81,14 +81,14 @@ ok 78 - col_isnt_fk with no FKs should have the proper diagnostics
8181
ok 79 - col_isnt_fk with no FKs should pass
8282
ok 80 - col_isnt_fk with no FKs should have the proper description
8383
ok 81 - col_isnt_fk with no FKs should have the proper diagnostics
84-
ok 82 - col_isnt_fk( schema, table, column[], description ) should fail
85-
ok 83 - col_isnt_fk( schema, table, column[], description ) should have the proper description
86-
ok 84 - col_isnt_fk( schema, table, column[] ) should fail
87-
ok 85 - col_isnt_fk( schema, table, column[] ) should have the proper description
88-
ok 86 - col_isnt_fk( table, column[], description ) should fail
89-
ok 87 - col_isnt_fk( table, column[], description ) should have the proper description
90-
ok 88 - col_isnt_fk( table, column[] ) should fail
91-
ok 89 - col_isnt_fk( table, column[] ) should have the proper description
84+
ok 82 - col_isnt_fk( schema, table, columns[], description ) should fail
85+
ok 83 - col_isnt_fk( schema, table, columns[], description ) should have the proper description
86+
ok 84 - col_isnt_fk( schema, table, columns[] ) should fail
87+
ok 85 - col_isnt_fk( schema, table, columns[] ) should have the proper description
88+
ok 86 - col_isnt_fk( table, columns[], description ) should fail
89+
ok 87 - col_isnt_fk( table, columns[], description ) should have the proper description
90+
ok 88 - col_isnt_fk( table, columns[] ) should fail
91+
ok 89 - col_isnt_fk( table, columns[] ) should have the proper description
9292
ok 90 - full fk_ok array should pass
9393
ok 91 - full fk_ok array should have the proper description
9494
ok 92 - pg_my_temp_schema() should pass

test/expected/pktap.out

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ ok 57 - col_is_pk( schema, table, column, description ) fail should have the pro
6060
ok 58 - col_is_pk( table, column, description ) fail should fail
6161
ok 59 - col_is_pk( table, column, description ) fail should have the proper description
6262
ok 60 - col_is_pk( table, column, description ) fail should have the proper diagnostics
63-
ok 61 - col_is_pk( schema, table, column[], description ) should pass
64-
ok 62 - col_is_pk( schema, table, column[], description ) should have the proper description
65-
ok 63 - col_is_pk( schema, table, column[], description ) should have the proper diagnostics
66-
ok 64 - col_is_pk( schema, table, column[] ) should pass
67-
ok 65 - col_is_pk( schema, table, column[] ) should have the proper description
68-
ok 66 - col_is_pk( schema, table, column[] ) should have the proper diagnostics
69-
ok 67 - col_is_pk( table, column[], description ) should pass
70-
ok 68 - col_is_pk( table, column[], description ) should have the proper description
71-
ok 69 - col_is_pk( table, column[], description ) should have the proper diagnostics
72-
ok 70 - col_is_pk( table, column[] ) should pass
73-
ok 71 - col_is_pk( table, column[] ) should have the proper description
74-
ok 72 - col_is_pk( table, column[] ) should have the proper diagnostics
63+
ok 61 - col_is_pk( schema, table, columns[], description ) should pass
64+
ok 62 - col_is_pk( schema, table, columns[], description ) should have the proper description
65+
ok 63 - col_is_pk( schema, table, columns[], description ) should have the proper diagnostics
66+
ok 64 - col_is_pk( schema, table, columns[] ) should pass
67+
ok 65 - col_is_pk( schema, table, columns[] ) should have the proper description
68+
ok 66 - col_is_pk( schema, table, columns[] ) should have the proper diagnostics
69+
ok 67 - col_is_pk( table, columns[], description ) should pass
70+
ok 68 - col_is_pk( table, columns[], description ) should have the proper description
71+
ok 69 - col_is_pk( table, columns[], description ) should have the proper diagnostics
72+
ok 70 - col_is_pk( table, columns[] ) should pass
73+
ok 71 - col_is_pk( table, columns[] ) should have the proper description
74+
ok 72 - col_is_pk( table, columns[] ) should have the proper diagnostics
7575
ok 73 - col_isnt_pk( schema, table, column, description ) should fail
7676
ok 74 - col_isnt_pk( schema, table, column, description ) should have the proper description
7777
ok 75 - col_isnt_pk( schema, table, column, description ) should have the proper diagnostics
@@ -90,15 +90,15 @@ ok 87 - col_isnt_pk( schema, table, column, description ) pass should have the p
9090
ok 88 - col_isnt_pk( table, column, description ) pass should pass
9191
ok 89 - col_isnt_pk( table, column, description ) pass should have the proper description
9292
ok 90 - col_isnt_pk( table, column, description ) pass should have the proper diagnostics
93-
ok 91 - col_isnt_pk( schema, table, column[], description ) should pass
94-
ok 92 - col_isnt_pk( schema, table, column[], description ) should have the proper description
95-
ok 93 - col_isnt_pk( schema, table, column[], description ) should have the proper diagnostics
96-
ok 94 - col_isnt_pk( schema, table, column[] ) should pass
97-
ok 95 - col_isnt_pk( schema, table, column[] ) should have the proper description
98-
ok 96 - col_isnt_pk( schema, table, column[] ) should have the proper diagnostics
99-
ok 97 - col_isnt_pk( table, column[], description ) should pass
100-
ok 98 - col_isnt_pk( table, column[], description ) should have the proper description
101-
ok 99 - col_isnt_pk( table, column[], description ) should have the proper diagnostics
102-
ok 100 - col_isnt_pk( table, column[] ) should pass
103-
ok 101 - col_isnt_pk( table, column[] ) should have the proper description
104-
ok 102 - col_isnt_pk( table, column[] ) should have the proper diagnostics
93+
ok 91 - col_isnt_pk( schema, table, columns[], description ) should pass
94+
ok 92 - col_isnt_pk( schema, table, columns[], description ) should have the proper description
95+
ok 93 - col_isnt_pk( schema, table, columns[], description ) should have the proper diagnostics
96+
ok 94 - col_isnt_pk( schema, table, columns[] ) should pass
97+
ok 95 - col_isnt_pk( schema, table, columns[] ) should have the proper description
98+
ok 96 - col_isnt_pk( schema, table, columns[] ) should have the proper diagnostics
99+
ok 97 - col_isnt_pk( table, columns[], description ) should pass
100+
ok 98 - col_isnt_pk( table, columns[], description ) should have the proper description
101+
ok 99 - col_isnt_pk( table, columns[], description ) should have the proper diagnostics
102+
ok 100 - col_isnt_pk( table, columns[] ) should pass
103+
ok 101 - col_isnt_pk( table, columns[] ) should have the proper description
104+
ok 102 - col_isnt_pk( table, columns[] ) should have the proper diagnostics

test/expected/unique.out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ ok 42 - col_is_unique( schema, table, column, description ) fail should have the
4545
ok 43 - col_is_unique( table, column, description ) fail should fail
4646
ok 44 - col_is_unique( table, column, description ) fail should have the proper description
4747
ok 45 - col_is_unique( table, column, description ) fail should have the proper diagnostics
48-
ok 46 - col_is_unique( schema, table, column[], description ) should pass
49-
ok 47 - col_is_unique( schema, table, column[], description ) should have the proper description
50-
ok 48 - col_is_unique( schema, table, column[], description ) should have the proper diagnostics
51-
ok 49 - col_is_unique( table, column[], description ) should pass
52-
ok 50 - col_is_unique( table, column[], description ) should have the proper description
53-
ok 51 - col_is_unique( table, column[], description ) should have the proper diagnostics
54-
ok 52 - col_is_unique( table, column[] ) should pass
55-
ok 53 - col_is_unique( table, column[] ) should have the proper description
56-
ok 54 - col_is_unique( table, column[] ) should have the proper diagnostics
48+
ok 46 - col_is_unique( schema, table, columns[], description ) should pass
49+
ok 47 - col_is_unique( schema, table, columns[], description ) should have the proper description
50+
ok 48 - col_is_unique( schema, table, columns[], description ) should have the proper diagnostics
51+
ok 49 - col_is_unique( table, columns[], description ) should pass
52+
ok 50 - col_is_unique( table, columns[], description ) should have the proper description
53+
ok 51 - col_is_unique( table, columns[], description ) should have the proper diagnostics
54+
ok 52 - col_is_unique( table, columns[] ) should pass
55+
ok 53 - col_is_unique( table, columns[] ) should have the proper description
56+
ok 54 - col_is_unique( table, columns[] ) should have the proper diagnostics

0 commit comments

Comments
 (0)