diff -Nru pgtap-0.98.0-22-gda005fb/Changes pgtap-0.99.0/Changes --- pgtap-0.98.0-22-gda005fb/Changes 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/Changes 2018-09-16 20:55:06.000000000 +0000 @@ -1,7 +1,7 @@ Revision history for pgTAP ========================== -0.99.0 +0.99.0 2018-09-16T20:55:41Z --------------------------- * Updated introductory documentation. A lot has changed over the years! * Added the "Secrets of the pgTAP Mavens" section of the documentation. @@ -12,7 +12,7 @@ * Changed the diagnostic output of extra and missing values from the `*_are()` functions to sort the extra and missing values. Fixes a test failure on PostgreSQL 10, and generally makes the diagnostics more deterministic and - easier to read and. Thanks to Michael Glaesemann for the report (#158)! + easier to read. Thanks to Michael Glaesemann for the report (#158)! * Fixed an issue on PostgreSQL 11, where the `pg_class.relhaspkey` column has been removed. The primary key testing functions now refer to `pg_index.indisprimary`, instead. Thanks to Keith Fiske for the report @@ -20,10 +20,17 @@ * Fixed an issue on PostgreSQL 11, where the `pg_proc.proisagg` column has been replaced with the more generically useful `pg_proc.prokind`. Thanks to Keith Fiske for the report (#174)! -* Documented that a bar `RECORD` can be passed to `row_eq()` on PostgreSQL 11, +* Documented that a `RECORD` can be passed to `row_eq()` on PostgreSQL 11, and fixed the tests to match this new functionality. * Removed tests that only ran on 8.0, support for which was discontinued in v0.90.0. +* Removed `test/sql/run*` tests, which intentionally fail, from the `test` + target in the `Makefile`. It's not meaningful to test them via `pg_prove`; + they must instead be tested by `make installcheck`, so their output can be + compared against output that varies by PostgreSQL version. Thanks to Jim Nasby + for the report (#172). +* Fixed a bug where `have_fk()` would fail if the table had no primary key. + Thanks to @bigmodem for the report! (#171). 0.98.0 2017-11-06T22:30:54Z --------------------------- diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-10.patch pgtap-0.99.0/compat/install-10.patch --- pgtap-0.98.0-22-gda005fb/compat/install-10.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-10.patch 2018-09-16 20:55:06.000000000 +0000 @@ -1,6 +1,6 @@ --- sql/pgtap.sql +++ sql/pgtap.sql -@@ -2487,7 +2487,7 @@ +@@ -2483,7 +2483,7 @@ || p.prorettype::regtype AS returns, p.prolang AS langoid, p.proisstrict AS is_strict, @@ -9,7 +9,7 @@ p.prosecdef AS is_definer, p.proretset AS returns_set, p.provolatile::char AS volatility, -@@ -5651,7 +5651,7 @@ +@@ -5647,7 +5647,7 @@ CREATE OR REPLACE FUNCTION _agg ( NAME, NAME, NAME[] ) RETURNS BOOLEAN AS $$ @@ -18,7 +18,7 @@ FROM tap_funky WHERE schema = $1 AND name = $2 -@@ -5660,12 +5660,12 @@ +@@ -5656,12 +5656,12 @@ CREATE OR REPLACE FUNCTION _agg ( NAME, NAME ) RETURNS BOOLEAN AS $$ @@ -33,7 +33,7 @@ FROM tap_funky WHERE name = $1 AND args = array_to_string($2, ',') -@@ -5674,7 +5674,7 @@ +@@ -5670,7 +5670,7 @@ CREATE OR REPLACE FUNCTION _agg ( NAME ) RETURNS BOOLEAN AS $$ diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-8.1.patch pgtap-0.99.0/compat/install-8.1.patch --- pgtap-0.98.0-22-gda005fb/compat/install-8.1.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-8.1.patch 2018-09-16 20:55:06.000000000 +0000 @@ -1,6 +1,6 @@ --- sql/pgtap.sql +++ sql/pgtap.sql -@@ -2270,13 +2270,13 @@ +@@ -2266,13 +2266,13 @@ CREATE OR REPLACE FUNCTION _constraint ( NAME, NAME, CHAR, NAME[], TEXT, TEXT ) RETURNS TEXT AS $$ DECLARE @@ -18,7 +18,7 @@ END LOOP; IF array_upper(keys, 0) = 1 THEN have := 'No ' || $6 || ' constraints'; -@@ -2294,13 +2294,13 @@ +@@ -2290,13 +2290,13 @@ CREATE OR REPLACE FUNCTION _constraint ( NAME, CHAR, NAME[], TEXT, TEXT ) RETURNS TEXT AS $$ DECLARE @@ -36,7 +36,7 @@ END LOOP; IF array_upper(keys, 0) = 1 THEN have := 'No ' || $5 || ' constraints'; -@@ -6190,7 +6190,7 @@ +@@ -6186,7 +6186,7 @@ CREATE OR REPLACE FUNCTION _runem( text[], boolean ) RETURNS SETOF TEXT AS $$ DECLARE @@ -45,7 +45,7 @@ lbound int := array_lower($1, 1); BEGIN IF lbound IS NULL THEN RETURN; END IF; -@@ -6198,8 +6198,8 @@ +@@ -6194,8 +6194,8 @@ -- Send the name of the function to diag if warranted. IF $2 THEN RETURN NEXT diag( $1[i] || '()' ); END IF; -- Execute the tap function and return its results. @@ -56,7 +56,7 @@ END LOOP; END LOOP; RETURN; -@@ -6268,7 +6268,7 @@ +@@ -6264,7 +6264,7 @@ setup ALIAS FOR $3; teardown ALIAS FOR $4; tests ALIAS FOR $5; @@ -65,7 +65,7 @@ tfaild INTEGER := 0; ffaild INTEGER := 0; tnumb INTEGER := 0; -@@ -6278,7 +6278,7 @@ +@@ -6274,7 +6274,7 @@ BEGIN -- No plan support. PERFORM * FROM no_plan(); @@ -74,7 +74,7 @@ EXCEPTION -- Catch all exceptions and simply rethrow custom exceptions. This -- will roll back everything in the above block. -@@ -6317,18 +6317,18 @@ +@@ -6313,18 +6313,18 @@ BEGIN BEGIN -- Run the setup functions. @@ -99,7 +99,7 @@ END LOOP; -- Emit the plan. -@@ -6384,11 +6384,11 @@ +@@ -6380,11 +6380,11 @@ END LOOP; -- Run the shutdown functions. @@ -114,7 +114,7 @@ END LOOP; -- Clean up and return. -@@ -7646,7 +7646,7 @@ +@@ -7642,7 +7642,7 @@ DECLARE rec RECORD; BEGIN diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-8.2.patch pgtap-0.99.0/compat/install-8.2.patch --- pgtap-0.98.0-22-gda005fb/compat/install-8.2.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-8.2.patch 2018-09-16 20:55:06.000000000 +0000 @@ -117,7 +117,7 @@ ), ''); $$ LANGUAGE sql IMMUTABLE; -@@ -2480,7 +2523,7 @@ +@@ -2476,7 +2519,7 @@ pg_catalog.pg_get_userbyid(p.proowner) AS owner, array_to_string(p.proargtypes::regtype[], ',') AS args, CASE p.proretset WHEN TRUE THEN 'setof ' ELSE '' END @@ -126,7 +126,7 @@ p.prolang AS langoid, p.proisstrict AS is_strict, p.proisagg AS is_agg, -@@ -3685,63 +3728,6 @@ +@@ -3681,63 +3724,6 @@ SELECT ok( NOT _has_type( $1, ARRAY['e'] ), ('Enum ' || quote_ident($1) || ' should not exist')::text ); $$ LANGUAGE sql; @@ -190,7 +190,7 @@ CREATE OR REPLACE FUNCTION _has_role( NAME ) RETURNS BOOLEAN AS $$ SELECT EXISTS( -@@ -6332,17 +6318,17 @@ +@@ -6328,17 +6314,17 @@ BEGIN -- Run the setup functions. FOR tap IN SELECT * FROM _runem(setup, false) LOOP @@ -211,7 +211,7 @@ END LOOP; -- Emit the plan. -@@ -6381,7 +6367,7 @@ +@@ -6377,7 +6363,7 @@ tok := FALSE; RETURN NEXT regexp_replace( diag('Test died: ' || _error_diag( errstate, errmsg, detail, hint, context, schname, tabname, colname, chkname, typname @@ -220,7 +220,7 @@ errmsg := NULL; END IF; END; -@@ -6494,13 +6480,13 @@ +@@ -6490,13 +6476,13 @@ -- Find extra records. FOR rec in EXECUTE 'SELECT * FROM ' || have || ' EXCEPT ' || $4 || 'SELECT * FROM ' || want LOOP @@ -236,7 +236,7 @@ END LOOP; -- Drop the temporary tables. -@@ -6724,7 +6710,7 @@ +@@ -6720,7 +6706,7 @@ -- Find relevant records. FOR rec in EXECUTE 'SELECT * FROM ' || want || ' ' || $4 || ' SELECT * FROM ' || have LOOP @@ -245,7 +245,7 @@ END LOOP; -- Drop the temporary tables. -@@ -6819,11 +6805,11 @@ +@@ -6815,11 +6801,11 @@ FETCH want INTO want_rec; want_found := FOUND; WHILE have_found OR want_found LOOP @@ -260,7 +260,7 @@ ); END IF; rownum = rownum + 1; -@@ -6838,9 +6824,9 @@ +@@ -6834,9 +6820,9 @@ WHEN datatype_mismatch THEN RETURN ok( false, $3 ) || E'\n' || diag( E' Number of columns or their types differ between the queries' || @@ -273,7 +273,7 @@ END ); END; -@@ -6976,7 +6962,7 @@ +@@ -6972,7 +6958,7 @@ FETCH want INTO want_rec; want_found := FOUND; WHILE have_found OR want_found LOOP @@ -282,7 +282,7 @@ RETURN ok( true, $3 ); ELSE FETCH have INTO have_rec; -@@ -6990,8 +6976,8 @@ +@@ -6986,8 +6972,8 @@ WHEN datatype_mismatch THEN RETURN ok( false, $3 ) || E'\n' || diag( E' Columns differ between queries:\n' || @@ -293,7 +293,7 @@ ); END; $$ LANGUAGE plpgsql; -@@ -7116,9 +7102,9 @@ +@@ -7112,9 +7098,9 @@ DECLARE typeof regtype := pg_typeof($1); BEGIN @@ -306,7 +306,7 @@ END; $$ LANGUAGE plpgsql; -@@ -7139,7 +7125,7 @@ +@@ -7135,7 +7121,7 @@ BEGIN -- Find extra records. FOR rec in EXECUTE _query($1) LOOP @@ -315,7 +315,7 @@ END LOOP; -- What extra records do we have? -@@ -7307,7 +7293,7 @@ +@@ -7303,7 +7289,7 @@ t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid) ) @@ -324,7 +324,7 @@ AND n.nspname = $1 AND t.typtype = ANY( COALESCE($4, ARRAY['b', 'c', 'd', 'p', 'e']) ) EXCEPT -@@ -7325,7 +7311,7 @@ +@@ -7321,7 +7307,7 @@ t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid) ) @@ -333,7 +333,7 @@ AND n.nspname = $1 AND t.typtype = ANY( COALESCE($4, ARRAY['b', 'c', 'd', 'p', 'e']) ) ), -@@ -7358,7 +7344,7 @@ +@@ -7354,7 +7340,7 @@ t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid) ) @@ -342,7 +342,7 @@ AND n.nspname NOT IN ('pg_catalog', 'information_schema') AND pg_catalog.pg_type_is_visible(t.oid) AND t.typtype = ANY( COALESCE($3, ARRAY['b', 'c', 'd', 'p', 'e']) ) -@@ -7377,7 +7363,7 @@ +@@ -7373,7 +7359,7 @@ t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid) ) @@ -351,7 +351,7 @@ AND n.nspname NOT IN ('pg_catalog', 'information_schema') AND pg_catalog.pg_type_is_visible(t.oid) AND t.typtype = ANY( COALESCE($3, ARRAY['b', 'c', 'd', 'p', 'e']) ) -@@ -7661,10 +7647,12 @@ +@@ -7657,10 +7643,12 @@ rec RECORD; BEGIN EXECUTE _query($1) INTO rec; @@ -367,7 +367,7 @@ ); END; $$ LANGUAGE plpgsql; -@@ -7811,7 +7799,7 @@ +@@ -7807,7 +7795,7 @@ CREATE OR REPLACE FUNCTION display_oper ( NAME, OID ) RETURNS TEXT AS $$ @@ -376,7 +376,7 @@ $$ LANGUAGE SQL; -- operators_are( schema, operators[], description ) -@@ -7820,7 +7808,7 @@ +@@ -7816,7 +7804,7 @@ SELECT _areni( 'operators', ARRAY( @@ -385,7 +385,7 @@ FROM pg_catalog.pg_operator o JOIN pg_catalog.pg_namespace n ON o.oprnamespace = n.oid WHERE n.nspname = $1 -@@ -7832,7 +7820,7 @@ +@@ -7828,7 +7816,7 @@ SELECT $2[i] FROM generate_series(1, array_upper($2, 1)) s(i) EXCEPT @@ -394,7 +394,7 @@ FROM pg_catalog.pg_operator o JOIN pg_catalog.pg_namespace n ON o.oprnamespace = n.oid WHERE n.nspname = $1 -@@ -7853,7 +7841,7 @@ +@@ -7849,7 +7837,7 @@ SELECT _areni( 'operators', ARRAY( @@ -403,7 +403,7 @@ FROM pg_catalog.pg_operator o JOIN pg_catalog.pg_namespace n ON o.oprnamespace = n.oid WHERE pg_catalog.pg_operator_is_visible(o.oid) -@@ -7866,7 +7854,7 @@ +@@ -7862,7 +7850,7 @@ SELECT $1[i] FROM generate_series(1, array_upper($1, 1)) s(i) EXCEPT @@ -412,7 +412,7 @@ FROM pg_catalog.pg_operator o JOIN pg_catalog.pg_namespace n ON o.oprnamespace = n.oid WHERE pg_catalog.pg_operator_is_visible(o.oid) -@@ -8579,40 +8567,6 @@ +@@ -8575,40 +8563,6 @@ ); $$ LANGUAGE sql; diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-8.3.patch pgtap-0.99.0/compat/install-8.3.patch --- pgtap-0.98.0-22-gda005fb/compat/install-8.3.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-8.3.patch 2018-09-16 20:55:06.000000000 +0000 @@ -12,7 +12,7 @@ CREATE OR REPLACE FUNCTION pg_version_num() RETURNS integer AS $$ SELECT current_setting('server_version_num')::integer; -@@ -6814,7 +6819,7 @@ +@@ -6810,7 +6815,7 @@ FETCH want INTO want_rec; want_found := FOUND; WHILE have_found OR want_found LOOP @@ -21,7 +21,7 @@ RETURN ok( false, $3 ) || E'\n' || diag( ' Results differ beginning at row ' || rownum || E':\n' || ' have: ' || CASE WHEN have_found THEN have_rec::text ELSE 'NULL' END || E'\n' || -@@ -6971,7 +6976,7 @@ +@@ -6967,7 +6972,7 @@ FETCH want INTO want_rec; want_found := FOUND; WHILE have_found OR want_found LOOP @@ -30,7 +30,7 @@ RETURN ok( true, $3 ); ELSE FETCH have INTO have_rec; -@@ -7180,13 +7185,7 @@ +@@ -7176,13 +7181,7 @@ $$ LANGUAGE sql; -- collect_tap( tap, tap, tap ) @@ -45,7 +45,7 @@ RETURNS TEXT AS $$ SELECT array_to_string($1, E'\n'); $$ LANGUAGE sql; -@@ -7662,7 +7661,7 @@ +@@ -7658,7 +7657,7 @@ rec RECORD; BEGIN EXECUTE _query($1) INTO rec; diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-8.4.patch pgtap-0.99.0/compat/install-8.4.patch --- pgtap-0.98.0-22-gda005fb/compat/install-8.4.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-8.4.patch 2018-09-16 20:55:06.000000000 +0000 @@ -1,6 +1,6 @@ --- sql/pgtap.sql +++ sql/pgtap.sql -@@ -7688,7 +7688,6 @@ +@@ -7684,7 +7684,6 @@ JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = $1 AND c.relname = $2 @@ -8,7 +8,7 @@ EXCEPT SELECT $3[i] FROM generate_series(1, array_upper($3, 1)) s(i) -@@ -7703,7 +7702,6 @@ +@@ -7699,7 +7698,6 @@ JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = $1 AND c.relname = $2 @@ -16,7 +16,7 @@ ), $4 ); -@@ -7727,7 +7725,6 @@ +@@ -7723,7 +7721,6 @@ JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = $1 AND n.nspname NOT IN ('pg_catalog', 'information_schema') @@ -24,7 +24,7 @@ EXCEPT SELECT $2[i] FROM generate_series(1, array_upper($2, 1)) s(i) -@@ -7741,7 +7738,6 @@ +@@ -7737,7 +7734,6 @@ JOIN pg_catalog.pg_class c ON c.oid = t.tgrelid JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND n.nspname NOT IN ('pg_catalog', 'information_schema') diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-9.0.patch pgtap-0.99.0/compat/install-9.0.patch --- pgtap-0.98.0-22-gda005fb/compat/install-9.0.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-9.0.patch 2018-09-16 20:55:06.000000000 +0000 @@ -1,6 +1,6 @@ --- sql/pgtap.sql +++ sql/pgtap.sql -@@ -3693,7 +3693,7 @@ +@@ -3689,7 +3689,7 @@ AND n.nspname = $1 AND t.typname = $2 AND t.typtype = 'e' @@ -9,7 +9,7 @@ ), $3, $4 -@@ -3721,7 +3721,7 @@ +@@ -3717,7 +3717,7 @@ AND pg_catalog.pg_type_is_visible(t.oid) AND t.typname = $1 AND t.typtype = 'e' @@ -18,7 +18,7 @@ ), $2, $3 -@@ -6165,7 +6165,7 @@ +@@ -6161,7 +6161,7 @@ CREATE OR REPLACE FUNCTION findfuncs( NAME, TEXT, TEXT ) RETURNS TEXT[] AS $$ SELECT ARRAY( @@ -27,7 +27,7 @@ FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON p.pronamespace = n.oid WHERE n.nspname = $1 -@@ -6182,7 +6182,7 @@ +@@ -6178,7 +6178,7 @@ CREATE OR REPLACE FUNCTION findfuncs( TEXT, TEXT ) RETURNS TEXT[] AS $$ SELECT ARRAY( @@ -36,7 +36,7 @@ FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON p.pronamespace = n.oid WHERE pg_catalog.pg_function_is_visible(p.oid) -@@ -9684,137 +9684,6 @@ +@@ -9680,137 +9680,6 @@ GRANT SELECT ON tap_funky TO PUBLIC; GRANT SELECT ON pg_all_foreign_keys TO PUBLIC; diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-9.1.patch pgtap-0.99.0/compat/install-9.1.patch --- pgtap-0.98.0-22-gda005fb/compat/install-9.1.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-9.1.patch 2018-09-16 20:55:06.000000000 +0000 @@ -11,7 +11,7 @@ RETURN ok( FALSE, descr ) || E'\n' || diag( ' died: ' || _error_diag(SQLSTATE, SQLERRM, detail, hint, context, schname, tabname, colname, chkname, typname) ); -@@ -6369,10 +6365,6 @@ +@@ -6365,10 +6361,6 @@ -- Something went wrong. Record that fact. errstate := SQLSTATE; errmsg := SQLERRM; diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-9.2.patch pgtap-0.99.0/compat/install-9.2.patch --- pgtap-0.98.0-22-gda005fb/compat/install-9.2.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-9.2.patch 2018-09-16 20:55:06.000000000 +0000 @@ -14,7 +14,7 @@ RETURN ok( FALSE, descr ) || E'\n' || diag( ' died: ' || _error_diag(SQLSTATE, SQLERRM, detail, hint, context, schname, tabname, colname, chkname, typname) ); -@@ -6377,12 +6372,7 @@ +@@ -6373,12 +6388,7 @@ GET STACKED DIAGNOSTICS detail = PG_EXCEPTION_DETAIL, hint = PG_EXCEPTION_HINT, diff -Nru pgtap-0.98.0-22-gda005fb/compat/install-9.6.patch pgtap-0.99.0/compat/install-9.6.patch --- pgtap-0.98.0-22-gda005fb/compat/install-9.6.patch 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/compat/install-9.6.patch 2018-09-16 20:55:06.000000000 +0000 @@ -1,6 +1,6 @@ --- sql/pgtap.sql +++ sql/pgtap.sql -@@ -9893,136 +9893,6 @@ +@@ -9889,136 +9889,6 @@ ); $$ LANGUAGE sql; diff -Nru pgtap-0.98.0-22-gda005fb/contrib/pgtap.spec pgtap-0.99.0/contrib/pgtap.spec --- pgtap-0.98.0-22-gda005fb/contrib/pgtap.spec 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/contrib/pgtap.spec 2018-09-16 20:55:06.000000000 +0000 @@ -48,6 +48,9 @@ %{_docdir}/pgsql/contrib/README.pgtap %changelog +* Sun Sep 16 2018 David E. Wheeler 0.99.0-1 +- Update to v0.99.0. + * Mon Nov 6 2017 David E. Wheeler 0.98.0-1 - Update to v0.98.0. - Added pgTAP harness Perl module requirement. diff -Nru pgtap-0.98.0-22-gda005fb/debian/changelog pgtap-0.99.0/debian/changelog --- pgtap-0.98.0-22-gda005fb/debian/changelog 2018-07-31 11:05:05.000000000 +0000 +++ pgtap-0.99.0/debian/changelog 2018-10-12 20:44:47.000000000 +0000 @@ -1,3 +1,16 @@ +pgtap (0.99.0-2) unstable; urgency=medium + + * Upload for PostgreSQL 11. + + -- Christoph Berg Fri, 12 Oct 2018 22:44:47 +0200 + +pgtap (0.99.0-1) unstable; urgency=medium + + * New upstream release. + * Mark pgtap-doc as Multi-Arch: foreign. + + -- Christoph Berg Wed, 19 Sep 2018 17:52:38 +0200 + pgtap (0.98.0-22-gda005fb-1) unstable; urgency=medium * New upstream snapshot. diff -Nru pgtap-0.98.0-22-gda005fb/debian/control pgtap-0.99.0/debian/control --- pgtap-0.98.0-22-gda005fb/debian/control 2018-07-31 11:05:05.000000000 +0000 +++ pgtap-0.99.0/debian/control 2018-10-12 20:44:47.000000000 +0000 @@ -33,6 +33,7 @@ Package: pgtap-doc Section: doc Architecture: all +Multi-Arch: foreign Depends: ${misc:Depends} Description: Unit testing framework for PostgreSQL - documentation pgTAP is a suite of database functions that make it easy to write @@ -44,11 +45,11 @@ . This package contains the documentation for pgTAP. -Package: postgresql-10-pgtap +Package: postgresql-11-pgtap Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, - postgresql-10 + postgresql-11 Replaces: pgtap (<< 0.95) Breaks: pgtap (<< 0.95) Recommends: pgtap-doc, @@ -56,7 +57,7 @@ libtest-harness-perl, libtap-harness-archive-perl Provides: postgresql-pgtap -Description: Unit testing framework extension for PostgreSQL 10 +Description: Unit testing framework extension for PostgreSQL 11 pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts suitable for harvesting, analysis, and reporting by a TAP harness, such as those used in Perl @@ -64,5 +65,5 @@ . TAP is the Test Anything Protocol (http://testanything.org/). . - This package contains the extension for PostgreSQL 10. + This package contains the extension for PostgreSQL 11. diff -Nru pgtap-0.98.0-22-gda005fb/debian/control.in pgtap-0.99.0/debian/control.in --- pgtap-0.98.0-22-gda005fb/debian/control.in 2018-07-31 11:03:51.000000000 +0000 +++ pgtap-0.99.0/debian/control.in 2018-09-19 16:06:47.000000000 +0000 @@ -33,6 +33,7 @@ Package: pgtap-doc Section: doc Architecture: all +Multi-Arch: foreign Depends: ${misc:Depends} Description: Unit testing framework for PostgreSQL - documentation pgTAP is a suite of database functions that make it easy to write diff -Nru pgtap-0.98.0-22-gda005fb/debian/tests/control pgtap-0.99.0/debian/tests/control --- pgtap-0.98.0-22-gda005fb/debian/tests/control 2018-07-31 11:05:05.000000000 +0000 +++ pgtap-0.99.0/debian/tests/control 2018-10-12 20:44:47.000000000 +0000 @@ -1,3 +1,3 @@ -Depends: @, postgresql-server-dev-all, postgresql-contrib-10, make, patch +Depends: @, postgresql-server-dev-all, postgresql-contrib-11, make, patch Tests: installcheck Restrictions: allow-stderr diff -Nru pgtap-0.98.0-22-gda005fb/doc/pgtap.mmd pgtap-0.99.0/doc/pgtap.mmd --- pgtap-0.98.0-22-gda005fb/doc/pgtap.mmd 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/doc/pgtap.mmd 2018-09-16 20:55:06.000000000 +0000 @@ -3446,7 +3446,7 @@ **Parameters** `:schema` -: Name of a schema in which to not find the function. +: Name of a schema in which to find the function. `:function` : Name of a function. @@ -8059,7 +8059,7 @@ Author ------ -[David E. Wheeler](http://theory.pm/) +[David E. Wheeler](http://justatheory.com/) Credits ------- @@ -8070,7 +8070,7 @@ Copyright and License --------------------- -Copyright (c) 2008-2017 David E. Wheeler. Some rights reserved. +Copyright (c) 2008-2018 David E. Wheeler. Some rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is diff -Nru pgtap-0.98.0-22-gda005fb/Makefile pgtap-0.99.0/Makefile --- pgtap-0.98.0-22-gda005fb/Makefile 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/Makefile 2018-09-16 20:55:06.000000000 +0000 @@ -27,12 +27,12 @@ VERSION = $(shell $(PG_CONFIG) --version | awk '{print $$2}') # We support 8.1 and later. -ifeq ($(shell echo $(VERSION) | grep -qE " 7[.]|8[.]0" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(7[.]|8[.]0)" && echo yes || echo no),yes) $(error pgTAP requires PostgreSQL 8.1 or later. This is $(VERSION)) endif # Compile the C code only if we're on 8.3 or older. -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][123]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][123]" && echo yes || echo no),yes) MODULES = src/pgtap endif @@ -41,7 +41,7 @@ all: $(_IN_PATCHED) sql/pgtap.sql sql/uninstall_pgtap.sql sql/pgtap-core.sql sql/pgtap-schema.sql # Add extension build targets on 9.1 and up. -ifeq ($(shell echo $(VERSION) | grep -qE "8[.]|9[.]0" && echo no || echo yes),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(8[.]|9[.]0)" && echo no || echo yes),yes) all: sql/$(MAINEXT)--$(EXTVERSION).sql sql/$(MAINEXT)-core--$(EXTVERSION).sql sql/$(MAINEXT)-schema--$(EXTVERSION).sql sql/$(MAINEXT)--$(EXTVERSION).sql: sql/$(MAINEXT).sql @@ -89,19 +89,19 @@ endif # Enum tests not supported by 8.2 and earlier. -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][12]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][12]" && echo yes || echo no),yes) TESTS := $(filter-out test/sql/enumtap.sql,$(TESTS)) REGRESS := $(filter-out enumtap,$(REGRESS)) endif # Values tests not supported by 8.1 and earlier. -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][1]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][1]" && echo yes || echo no),yes) TESTS := $(filter-out test/sql/enumtap.sql sql/valueset.sql,$(TESTS)) REGRESS := $(filter-out enumtap valueset,$(REGRESS)) endif # Partition tests tests not supported by 9.x and earlier. -ifeq ($(shell echo $(VERSION) | grep -qE "[89][.]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^[89][.]" && echo yes || echo no),yes) TESTS := $(filter-out test/sql/partitions.sql,$(TESTS)) REGRESS := $(filter-out partitions,$(REGRESS)) endif @@ -113,34 +113,34 @@ sql/pgtap.sql: sql/pgtap.sql.in test/setup.sql cp $< $@ -ifeq ($(shell echo $(VERSION) | grep -qE "([98]|10)[.]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^([98]|10)[.]" && echo yes || echo no),yes) patch -p0 < compat/install-10.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "9[.][0123456]|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][0123456]|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/install-9.6.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "9[.][01234]|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01234]|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/install-9.4.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "9[.][012]|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][012]|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/install-9.2.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "9[.][01]|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01]|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/install-9.1.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "9[.]0|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.]0|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/install-9.0.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][1234]" && echo yes || echo no),yes) patch -p0 < compat/install-8.4.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][123]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][123]" && echo yes || echo no),yes) patch -p0 < compat/install-8.3.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][12]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][12]" && echo yes || echo no),yes) patch -p0 < compat/install-8.2.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "8[.][1]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^8[.][1]" && echo yes || echo no),yes) patch -p0 < compat/install-8.1.patch endif sed -e 's,MODULE_PATHNAME,$$libdir/pgtap,g' -e 's,__OS__,$(OSNAME),g' -e 's,__VERSION__,$(NUMVERSION),g' sql/pgtap.sql > sql/pgtap.tmp @@ -150,24 +150,24 @@ EXTRA_CLEAN += sql/pgtap--0.97.0--0.98.0.sql sql/pgtap--0.97.0--0.98.0.sql: sql/pgtap--0.97.0--0.98.0.sql.in cp $< $@ -ifeq ($(shell echo $(VERSION) | grep -qE "[89][.]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^[89][.]" && echo yes || echo no),yes) patch -p0 < compat/9.6/pgtap--0.97.0--0.98.0.patch endif EXTRA_CLEAN += sql/pgtap--0.96.0--0.97.0.sql sql/pgtap--0.96.0--0.97.0.sql: sql/pgtap--0.96.0--0.97.0.sql.in cp $< $@ -ifeq ($(shell echo $(VERSION) | grep -qE "9[.][01234]|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01234]|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/9.4/pgtap--0.96.0--0.97.0.patch endif -ifeq ($(shell echo $(VERSION) | grep -qE "9[.]0|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.]0|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/9.0/pgtap--0.96.0--0.97.0.patch endif EXTRA_CLEAN += sql/pgtap--0.95.0--0.96.0.sql sql/pgtap--0.95.0--0.96.0.sql: sql/pgtap--0.95.0--0.96.0.sql.in cp $< $@ -ifeq ($(shell echo $(VERSION) | grep -qE "9[.][012]|8[.][1234]" && echo yes || echo no),yes) +ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][012]|8[.][1234])" && echo yes || echo no),yes) patch -p0 < compat/9.2/pgtap--0.95.0--0.96.0.patch endif @@ -199,7 +199,8 @@ # In addition to installcheck, one can also run the tests through pg_prove. test: test/setup.sql - pg_prove --pset tuples_only=1 $(TESTS) + # Filter-out tests that intentionally fail. They should be tested by installcheck. + pg_prove --pset tuples_only=1 $(filter-out test/sql/run%,$(TESTS)) html: multimarkdown doc/pgtap.mmd > doc/pgtap.html diff -Nru pgtap-0.98.0-22-gda005fb/README.md pgtap-0.99.0/README.md --- pgtap-0.98.0-22-gda005fb/README.md 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/README.md 2018-09-16 20:55:06.000000000 +0000 @@ -90,7 +90,7 @@ Copyright and License --------------------- -Copyright (c) 2008-2017 David E. Wheeler. Some rights reserved. +Copyright (c) 2008-2018 David E. Wheeler. Some rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is diff -Nru pgtap-0.98.0-22-gda005fb/release.md pgtap-0.99.0/release.md --- pgtap-0.98.0-22-gda005fb/release.md 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/release.md 2018-09-16 20:55:06.000000000 +0000 @@ -4,8 +4,9 @@ Here are the steps to take to make a release of pgTAP: * Test on all supported PostgreSQL versions, starting with the latest version - (10) and moving backward in order (9.6, 9.5, 9.4, etc.). For each version, - ensure that: + (10) and moving backward in order (9.6, 9.5, 9.4, etc.). + [pgenv](https://github.com/theory/pgenv/) is a handy tool for installing and + switching between versions. For each version, ensure that: + Patches apply cleanly (try to eliminate Hunk warnings for patches to `pgtap.sql` itself, usually by fixing line numbers) @@ -14,15 +15,15 @@ + `ALTER EXTENSION pgtap UPDATE;` works on 9.1 and higher. - + `CREATE EXTENSION pgtap;` works on 9.1 and higer. + + `CREATE EXTENSION pgtap;` works on 9.1 and higher. + All tests pass in `make installcheck` (on 8.1, move the pgtap source - dir into the postgres source contrib directory and run + dir into the postgres source `contrib` directory and run `make NO_PGXS=1 installcheck`) -* If you've made any significant changes, test all supported version again in - foreward order (8.1, 8.2, 8.3, etc.) to make sure the changes didn't break - any later versions. +* If you've made any significant changes while testing versions backward, test + them again in forward order (8.1, 8.2, 8.3, etc.) to make sure the changes + didn't break any later versions. * Review the documentation in `doc/pgtap.mmd`, and make any necessary changes, including to the list of PostgreSQL version-compatibility notes at the end @@ -39,7 +40,7 @@ Perl module installed), then checkout the `gh-pages` branch and make these changes: - + Open `documentatoin.html` and delete all the lines between these "DOC" + + Open `documentation.html` and delete all the lines between these "DOC" comments, until the main div looks like this:
diff -Nru pgtap-0.98.0-22-gda005fb/sql/pgtap--0.98.0--0.99.0.sql pgtap-0.99.0/sql/pgtap--0.98.0--0.99.0.sql --- pgtap-0.98.0-22-gda005fb/sql/pgtap--0.98.0--0.99.0.sql 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/sql/pgtap--0.98.0--0.99.0.sql 2018-09-16 20:55:06.000000000 +0000 @@ -160,3 +160,30 @@ RETURNS BOOLEAN AS $$ SELECT kind = 'a' FROM tap_funky WHERE name = $1 AND is_visible; $$ LANGUAGE SQL; + +-- _hasc( schema, table, constraint_type ) +CREATE OR REPLACE FUNCTION _hasc ( NAME, NAME, CHAR ) +RETURNS BOOLEAN AS $$ + SELECT EXISTS( + SELECT true + FROM pg_catalog.pg_namespace n + JOIN pg_catalog.pg_class c ON c.relnamespace = n.oid + JOIN pg_catalog.pg_constraint x ON c.oid = x.conrelid + WHERE n.nspname = $1 + AND c.relname = $2 + AND x.contype = $3 + ); +$$ LANGUAGE sql; + +-- _hasc( table, constraint_type ) +CREATE OR REPLACE FUNCTION _hasc ( NAME, CHAR ) +RETURNS BOOLEAN AS $$ + SELECT EXISTS( + SELECT true + FROM pg_catalog.pg_class c + JOIN pg_catalog.pg_constraint x ON c.oid = x.conrelid + WHERE pg_table_is_visible(c.oid) + AND c.relname = $1 + AND x.contype = $2 + ); +$$ LANGUAGE sql; diff -Nru pgtap-0.98.0-22-gda005fb/sql/pgtap.sql.in pgtap-0.99.0/sql/pgtap.sql.in --- pgtap-0.98.0-22-gda005fb/sql/pgtap.sql.in 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/sql/pgtap.sql.in 2018-09-16 20:55:06.000000000 +0000 @@ -1759,9 +1759,7 @@ FROM pg_catalog.pg_namespace n JOIN pg_catalog.pg_class c ON c.relnamespace = n.oid JOIN pg_catalog.pg_constraint x ON c.oid = x.conrelid - JOIN pg_catalog.pg_index i ON c.oid = i.indrelid - WHERE i.indisprimary = true - AND n.nspname = $1 + WHERE n.nspname = $1 AND c.relname = $2 AND x.contype = $3 ); @@ -1774,9 +1772,7 @@ SELECT true FROM pg_catalog.pg_class c JOIN pg_catalog.pg_constraint x ON c.oid = x.conrelid - JOIN pg_catalog.pg_index i ON c.oid = i.indrelid - WHERE i.indisprimary = true - AND pg_table_is_visible(c.oid) + WHERE pg_table_is_visible(c.oid) AND c.relname = $1 AND x.contype = $2 ); diff -Nru pgtap-0.98.0-22-gda005fb/test/expected/fktap.out pgtap-0.99.0/test/expected/fktap.out --- pgtap-0.98.0-22-gda005fb/test/expected/fktap.out 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/test/expected/fktap.out 2018-09-16 20:55:06.000000000 +0000 @@ -1,130 +1,134 @@ \unset ECHO -1..128 +1..132 ok 1 - has_fk( schema, table, description ) should pass ok 2 - has_fk( schema, table, description ) should have the proper description ok 3 - has_fk( table, description ) should pass ok 4 - has_fk( table, description ) should have the proper description -ok 5 - has_fk( table ) should pass -ok 6 - has_fk( table ) should have the proper description -ok 7 - has_fk( schema, table, description ) fail should fail -ok 8 - has_fk( schema, table, description ) fail should have the proper description -ok 9 - has_fk( table, description ) fail should fail -ok 10 - has_fk( table, description ) fail should have the proper description -ok 11 - hasnt_fk( schema, table, description ) should fail -ok 12 - hasnt_fk( schema, table, description ) should have the proper description -ok 13 - hasnt_fk( table, description ) should fail -ok 14 - hasnt_fk( table, description ) should have the proper description -ok 15 - hasnt_fk( table ) should fail -ok 16 - hasnt_fk( table ) should have the proper description -ok 17 - hasnt_fk( schema, table, description ) pass should pass -ok 18 - hasnt_fk( schema, table, description ) pass should have the proper description -ok 19 - hasnt_fk( table, description ) pass should pass -ok 20 - hasnt_fk( table, description ) pass should have the proper description -ok 21 - col_is_fk( schema, table, column, description ) should pass -ok 22 - col_is_fk( schema, table, column, description ) should have the proper description -ok 23 - col_is_fk( table, column, description ) should pass -ok 24 - col_is_fk( table, column, description ) should have the proper description -ok 25 - col_is_fk( table, column ) should pass -ok 26 - col_is_fk( table, column ) should have the proper description -ok 27 - col_is_fk( schema, table, column, description ) should fail -ok 28 - col_is_fk( schema, table, column, description ) should have the proper description -ok 29 - col_is_fk( schema, table, column, description ) should have the proper diagnostics -ok 30 - col_is_fk( table, column, description ) should fail -ok 31 - col_is_fk( table, column, description ) should have the proper description -ok 32 - col_is_fk( table, column, description ) should have the proper diagnostics -ok 33 - multi-fk col_is_fk test should pass -ok 34 - multi-fk col_is_fk test should have the proper description -ok 35 - col_is_fk with no FKs should fail -ok 36 - col_is_fk with no FKs should have the proper description -ok 37 - col_is_fk with no FKs should have the proper diagnostics -ok 38 - col_is_fk with no FKs should fail -ok 39 - col_is_fk with no FKs should have the proper description -ok 40 - col_is_fk with no FKs should have the proper diagnostics -ok 41 - col_is_fk( schema, table, column[], description ) should pass -ok 42 - col_is_fk( schema, table, column[], description ) should have the proper description -ok 43 - col_is_fk( table, column[], description ) should pass -ok 44 - col_is_fk( table, column[], description ) should have the proper description -ok 45 - col_is_fk( table, column[] ) should pass -ok 46 - col_is_fk( table, column[] ) should have the proper description -ok 47 - col_isnt_fk( schema, table, column, description ) should fail -ok 48 - col_isnt_fk( schema, table, column, description ) should have the proper description -ok 49 - col_isnt_fk( schema, table, column, description ) should have the proper diagnostics -ok 50 - col_isnt_fk( table, column, description ) should fail -ok 51 - col_isnt_fk( table, column, description ) should have the proper description -ok 52 - col_isnt_fk( table, column, description ) should have the proper diagnostics -ok 53 - col_isnt_fk( table, column ) should fail -ok 54 - col_isnt_fk( table, column ) should have the proper description -ok 55 - col_isnt_fk( table, column ) should have the proper diagnostics -ok 56 - col_isnt_fk( schema, table, column, description ) should pass -ok 57 - col_isnt_fk( schema, table, column, description ) should have the proper description -ok 58 - col_isnt_fk( schema, table, column, description ) should have the proper diagnostics -ok 59 - col_isnt_fk( table, column, description ) should pass -ok 60 - col_isnt_fk( table, column, description ) should have the proper description -ok 61 - col_isnt_fk( table, column, description ) should have the proper diagnostics -ok 62 - multi-fk col_isnt_fk test should fail -ok 63 - multi-fk col_isnt_fk test should have the proper description -ok 64 - multi-fk col_isnt_fk test should have the proper diagnostics -ok 65 - col_isnt_fk with no FKs should pass -ok 66 - col_isnt_fk with no FKs should have the proper description -ok 67 - col_isnt_fk with no FKs should have the proper diagnostics -ok 68 - col_isnt_fk with no FKs should pass -ok 69 - col_isnt_fk with no FKs should have the proper description -ok 70 - col_isnt_fk with no FKs should have the proper diagnostics -ok 71 - col_isnt_fk( schema, table, column[], description ) should fail -ok 72 - col_isnt_fk( schema, table, column[], description ) should have the proper description -ok 73 - col_isnt_fk( table, column[], description ) should fail -ok 74 - col_isnt_fk( table, column[], description ) should have the proper description -ok 75 - col_isnt_fk( table, column[] ) should fail -ok 76 - col_isnt_fk( table, column[] ) should have the proper description -ok 77 - full fk_ok array should pass -ok 78 - full fk_ok array should have the proper description -ok 79 - multiple fk fk_ok desc should pass -ok 80 - multiple fk fk_ok desc should have the proper description -ok 81 - fk_ok array desc should pass -ok 82 - fk_ok array desc should have the proper description -ok 83 - fk_ok array noschema desc should pass -ok 84 - fk_ok array noschema desc should have the proper description -ok 85 - multiple fk fk_ok noschema desc should pass -ok 86 - multiple fk fk_ok noschema desc should have the proper description -ok 87 - fk_ok array noschema should pass -ok 88 - fk_ok array noschema should have the proper description -ok 89 - basic fk_ok should pass -ok 90 - basic fk_ok should have the proper description -ok 91 - basic fk_ok desc should pass -ok 92 - basic fk_ok desc should have the proper description -ok 93 - basic fk_ok noschema should pass -ok 94 - basic fk_ok noschema should have the proper description -ok 95 - basic fk_ok noschema desc should pass -ok 96 - basic fk_ok noschema desc should have the proper description -ok 97 - basic fk_ok noschema desc should have the proper diagnostics -ok 98 - Test should pass -ok 99 - fk_ok fail should fail -ok 100 - fk_ok fail should have the proper description -ok 101 - fk_ok fail should have the proper diagnostics -ok 102 - fk_ok fail desc should fail -ok 103 - fk_ok fail desc should have the proper description -ok 104 - fk_ok fail desc should have the proper diagnostics -ok 105 - fk_ok fail no schema should fail -ok 106 - fk_ok fail no schema should have the proper description -ok 107 - fk_ok fail no schema should have the proper diagnostics -ok 108 - fk_ok fail no schema desc should fail -ok 109 - fk_ok fail no schema desc should have the proper description -ok 110 - fk_ok fail no schema desc should have the proper diagnostics -ok 111 - fk_ok bad PK test should fail -ok 112 - fk_ok bad PK test should have the proper description -ok 113 - fk_ok bad PK test should have the proper diagnostics -ok 114 - double fk schema test should pass -ok 115 - double fk schema test should have the proper description -ok 116 - double fk schema test should have the proper diagnostics -ok 117 - double fk test should pass -ok 118 - double fk test should have the proper description -ok 119 - double fk test should have the proper diagnostics -ok 120 - double fk and col schema test should pass -ok 121 - double fk and col schema test should have the proper description -ok 122 - double fk and col schema test should have the proper diagnostics -ok 123 - missing fk test should fail -ok 124 - missing fk test should have the proper description -ok 125 - missing fk test should have the proper diagnostics -ok 126 - bad FK column test should fail -ok 127 - bad FK column test should have the proper description -ok 128 - bad FK column test should have the proper diagnostics +ok 5 - has_fk( table4, description ) should pass +ok 6 - has_fk( table4, description ) should have the proper description +ok 7 - has_fk( schema, table4, description ) should pass +ok 8 - has_fk( schema, table4, description ) should have the proper description +ok 9 - has_fk( table ) should pass +ok 10 - has_fk( table ) should have the proper description +ok 11 - has_fk( schema, table, description ) fail should fail +ok 12 - has_fk( schema, table, description ) fail should have the proper description +ok 13 - has_fk( table, description ) fail should fail +ok 14 - has_fk( table, description ) fail should have the proper description +ok 15 - hasnt_fk( schema, table, description ) should fail +ok 16 - hasnt_fk( schema, table, description ) should have the proper description +ok 17 - hasnt_fk( table, description ) should fail +ok 18 - hasnt_fk( table, description ) should have the proper description +ok 19 - hasnt_fk( table ) should fail +ok 20 - hasnt_fk( table ) should have the proper description +ok 21 - hasnt_fk( schema, table, description ) pass should pass +ok 22 - hasnt_fk( schema, table, description ) pass should have the proper description +ok 23 - hasnt_fk( table, description ) pass should pass +ok 24 - hasnt_fk( table, description ) pass should have the proper description +ok 25 - col_is_fk( schema, table, column, description ) should pass +ok 26 - col_is_fk( schema, table, column, description ) should have the proper description +ok 27 - col_is_fk( table, column, description ) should pass +ok 28 - col_is_fk( table, column, description ) should have the proper description +ok 29 - col_is_fk( table, column ) should pass +ok 30 - col_is_fk( table, column ) should have the proper description +ok 31 - col_is_fk( schema, table, column, description ) should fail +ok 32 - col_is_fk( schema, table, column, description ) should have the proper description +ok 33 - col_is_fk( schema, table, column, description ) should have the proper diagnostics +ok 34 - col_is_fk( table, column, description ) should fail +ok 35 - col_is_fk( table, column, description ) should have the proper description +ok 36 - col_is_fk( table, column, description ) should have the proper diagnostics +ok 37 - multi-fk col_is_fk test should pass +ok 38 - multi-fk col_is_fk test should have the proper description +ok 39 - col_is_fk with no FKs should fail +ok 40 - col_is_fk with no FKs should have the proper description +ok 41 - col_is_fk with no FKs should have the proper diagnostics +ok 42 - col_is_fk with no FKs should fail +ok 43 - col_is_fk with no FKs should have the proper description +ok 44 - col_is_fk with no FKs should have the proper diagnostics +ok 45 - col_is_fk( schema, table, column[], description ) should pass +ok 46 - col_is_fk( schema, table, column[], description ) should have the proper description +ok 47 - col_is_fk( table, column[], description ) should pass +ok 48 - col_is_fk( table, column[], description ) should have the proper description +ok 49 - col_is_fk( table, column[] ) should pass +ok 50 - col_is_fk( table, column[] ) should have the proper description +ok 51 - col_isnt_fk( schema, table, column, description ) should fail +ok 52 - col_isnt_fk( schema, table, column, description ) should have the proper description +ok 53 - col_isnt_fk( schema, table, column, description ) should have the proper diagnostics +ok 54 - col_isnt_fk( table, column, description ) should fail +ok 55 - col_isnt_fk( table, column, description ) should have the proper description +ok 56 - col_isnt_fk( table, column, description ) should have the proper diagnostics +ok 57 - col_isnt_fk( table, column ) should fail +ok 58 - col_isnt_fk( table, column ) should have the proper description +ok 59 - col_isnt_fk( table, column ) should have the proper diagnostics +ok 60 - col_isnt_fk( schema, table, column, description ) should pass +ok 61 - col_isnt_fk( schema, table, column, description ) should have the proper description +ok 62 - col_isnt_fk( schema, table, column, description ) should have the proper diagnostics +ok 63 - col_isnt_fk( table, column, description ) should pass +ok 64 - col_isnt_fk( table, column, description ) should have the proper description +ok 65 - col_isnt_fk( table, column, description ) should have the proper diagnostics +ok 66 - multi-fk col_isnt_fk test should fail +ok 67 - multi-fk col_isnt_fk test should have the proper description +ok 68 - multi-fk col_isnt_fk test should have the proper diagnostics +ok 69 - col_isnt_fk with no FKs should pass +ok 70 - col_isnt_fk with no FKs should have the proper description +ok 71 - col_isnt_fk with no FKs should have the proper diagnostics +ok 72 - col_isnt_fk with no FKs should pass +ok 73 - col_isnt_fk with no FKs should have the proper description +ok 74 - col_isnt_fk with no FKs should have the proper diagnostics +ok 75 - col_isnt_fk( schema, table, column[], description ) should fail +ok 76 - col_isnt_fk( schema, table, column[], description ) should have the proper description +ok 77 - col_isnt_fk( table, column[], description ) should fail +ok 78 - col_isnt_fk( table, column[], description ) should have the proper description +ok 79 - col_isnt_fk( table, column[] ) should fail +ok 80 - col_isnt_fk( table, column[] ) should have the proper description +ok 81 - full fk_ok array should pass +ok 82 - full fk_ok array should have the proper description +ok 83 - multiple fk fk_ok desc should pass +ok 84 - multiple fk fk_ok desc should have the proper description +ok 85 - fk_ok array desc should pass +ok 86 - fk_ok array desc should have the proper description +ok 87 - fk_ok array noschema desc should pass +ok 88 - fk_ok array noschema desc should have the proper description +ok 89 - multiple fk fk_ok noschema desc should pass +ok 90 - multiple fk fk_ok noschema desc should have the proper description +ok 91 - fk_ok array noschema should pass +ok 92 - fk_ok array noschema should have the proper description +ok 93 - basic fk_ok should pass +ok 94 - basic fk_ok should have the proper description +ok 95 - basic fk_ok desc should pass +ok 96 - basic fk_ok desc should have the proper description +ok 97 - basic fk_ok noschema should pass +ok 98 - basic fk_ok noschema should have the proper description +ok 99 - basic fk_ok noschema desc should pass +ok 100 - basic fk_ok noschema desc should have the proper description +ok 101 - basic fk_ok noschema desc should have the proper diagnostics +ok 102 - Test should pass +ok 103 - fk_ok fail should fail +ok 104 - fk_ok fail should have the proper description +ok 105 - fk_ok fail should have the proper diagnostics +ok 106 - fk_ok fail desc should fail +ok 107 - fk_ok fail desc should have the proper description +ok 108 - fk_ok fail desc should have the proper diagnostics +ok 109 - fk_ok fail no schema should fail +ok 110 - fk_ok fail no schema should have the proper description +ok 111 - fk_ok fail no schema should have the proper diagnostics +ok 112 - fk_ok fail no schema desc should fail +ok 113 - fk_ok fail no schema desc should have the proper description +ok 114 - fk_ok fail no schema desc should have the proper diagnostics +ok 115 - fk_ok bad PK test should fail +ok 116 - fk_ok bad PK test should have the proper description +ok 117 - fk_ok bad PK test should have the proper diagnostics +ok 118 - double fk schema test should pass +ok 119 - double fk schema test should have the proper description +ok 120 - double fk schema test should have the proper diagnostics +ok 121 - double fk test should pass +ok 122 - double fk test should have the proper description +ok 123 - double fk test should have the proper diagnostics +ok 124 - double fk and col schema test should pass +ok 125 - double fk and col schema test should have the proper description +ok 126 - double fk and col schema test should have the proper diagnostics +ok 127 - missing fk test should fail +ok 128 - missing fk test should have the proper description +ok 129 - missing fk test should have the proper diagnostics +ok 130 - bad FK column test should fail +ok 131 - bad FK column test should have the proper description +ok 132 - bad FK column test should have the proper diagnostics diff -Nru pgtap-0.98.0-22-gda005fb/test/sql/fktap.sql pgtap-0.99.0/test/sql/fktap.sql --- pgtap-0.98.0-22-gda005fb/test/sql/fktap.sql 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/test/sql/fktap.sql 2018-09-16 20:55:06.000000000 +0000 @@ -1,7 +1,7 @@ \unset ECHO \i test/setup.sql -SELECT plan(128); +SELECT plan(132); --SELECT * from no_plan(); -- These will be rolled back. :-) @@ -17,7 +17,7 @@ ); CREATE TABLE public.pk2 ( - num int NOT NULL, + num int NOT NULL UNIQUE, dot int NOT NULL, PRIMARY KEY (num, dot) ); @@ -25,7 +25,7 @@ CREATE TABLE public.fk2 ( pk2_num int NOT NULL, pk2_dot int NOT NULL, - FOREIGN KEY(pk2_num, pk2_dot) REFERENCES pk2( num, dot) + FOREIGN KEY(pk2_num, pk2_dot) REFERENCES pk2(num, dot) ); CREATE TABLE public.fk3( @@ -36,6 +36,15 @@ foo_id INT NOT NULL, FOREIGN KEY(pk2_num, pk2_dot) REFERENCES pk2( num, dot) ); + +CREATE TABLE public.pk3( + id INT UNIQUE +); + +CREATE TABLE public.fk4 ( + id INT REFERENCES pk3(id) +); + RESET client_min_messages; /****************************************************************************/ @@ -55,6 +64,20 @@ ); SELECT * FROM check_test( + has_fk( 'fk4', 'fk4 should have an fk' ), + 'true', + 'has_fk( table4, description )', + 'fk4 should have an fk' +); + +SELECT * FROM check_test( + has_fk( 'public', 'fk4', 'fk4 should have an fk' ), + 'true', + 'has_fk( schema, table4, description )', + 'fk4 should have an fk' +); + +SELECT * FROM check_test( has_fk( 'fk' ), true, 'has_fk( table )', diff -Nru pgtap-0.98.0-22-gda005fb/test/sql/runjusttests.sql pgtap-0.99.0/test/sql/runjusttests.sql --- pgtap-0.98.0-22-gda005fb/test/sql/runjusttests.sql 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/test/sql/runjusttests.sql 2018-09-16 20:55:06.000000000 +0000 @@ -26,8 +26,8 @@ CREATE OR REPLACE FUNCTION whatever.testplpgsqldie() RETURNS SETOF TEXT AS $$ BEGIN - RETURN NEXT pass( 'plpgsql simple' ); - RETURN NEXT pass( 'plpgsql simple 2' ); + RETURN NEXT pass( 'plpgsql simple' ); -- Won't appear in results. + RETURN NEXT pass( 'plpgsql simple 2' ); -- Won't appear in results. INSERT INTO whatever.foo VALUES(1); RETURN NEXT is( MAX(id), 1, 'Should be a 1 in the test table') FROM whatever.foo; IF pg_version_num() >= 90300 THEN diff -Nru pgtap-0.98.0-22-gda005fb/test/sql/runtests.sql pgtap-0.99.0/test/sql/runtests.sql --- pgtap-0.98.0-22-gda005fb/test/sql/runtests.sql 2018-07-28 16:04:58.000000000 +0000 +++ pgtap-0.99.0/test/sql/runtests.sql 2018-09-16 20:55:06.000000000 +0000 @@ -61,8 +61,8 @@ CREATE OR REPLACE FUNCTION whatever.testplpgsqldie() RETURNS SETOF TEXT AS $$ BEGIN - RETURN NEXT pass( 'plpgsql simple' ); - RETURN NEXT pass( 'plpgsql simple 2' ); + RETURN NEXT pass( 'plpgsql simple' ); -- Won't appear in results. + RETURN NEXT pass( 'plpgsql simple 2' ); -- Won't appear in results. INSERT INTO whatever.foo VALUES(1); RETURN NEXT is( MAX(id), 1, 'Should be a 1 in the test table') FROM whatever.foo; IF pg_version_num() >= 90300 THEN