commit 829ee00e6efbd34faf34ce1901b822de38ad75c9
parent 70aa23721d69454371ff42807699b9b04cf7bc37
Author: Hubert depesz Lubaczewski <depesz@depesz.com>
Date: Tue, 18 Feb 2020 12:27:54 +0100
fix tests so that testing works
Diffstat:
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/t/00-load.sql.inc b/t/00-load.sql.inc
@@ -1,2 +1,2 @@
-- load pgtap - change next line to point to correct path for your system!
-\i /home/pgdba/work/share/postgresql/contrib/pgtap.sql
+create extension pgtap;
diff --git a/t/01-objects.sql b/t/01-objects.sql
@@ -2,7 +2,7 @@ BEGIN;
-- load pgtap - change next line to point to correct path for your system!
\i t/00-load.sql.inc
- SELECT plan(11);
+ SELECT plan(10);
SELECT has_schema( '_v', 'There should be schema _v for versioning to work.' );
SELECT has_table( '_v', 'patches', 'There should be _v.patches table for versioning to work.' );
@@ -14,10 +14,10 @@ BEGIN;
SELECT has_column( '_v', 'patches', 'conflicts', '_v.patches should have conflicts column.' );
SELECT has_function( '_v', 'register_patch', ARRAY[ 'text', 'text[]', 'text[]' ], 'register_patch(text, text[], text[]) should exist to be able to register patches' );
- SELECT has_function( '_v', 'register_patch', ARRAY[ 'text' ], 'register_patch(text) should exist to be able to register patches (in simpler way)' );
SELECT has_function( '_v', 'unregister_patch', ARRAY[ 'text' ], 'unregister_patch(text) should exist to be able to unregister patches that are no longer needed' );
SELECT is( ( SELECT count(*) FROM _v.patches ), 0::bigint, 'When running tests _v.patches table should be empty to prevent bad interactions between patches and tests.' );
+ SELECT * FROM finish();
ROLLBACK;
diff --git a/t/02-functionality.sql b/t/02-functionality.sql
@@ -12,8 +12,8 @@ BEGIN;
);
SELECT results_eq(
- 'SELECT patch_name, applied_tsz, applied_by, requires, conflicts FROM _v.patches',
- $$SELECT 'first_patch'::text as patch_name, now() as applied_tsz, current_user::TEXT as applied_by, '{}'::TEXT[] as requires, '{}'::TEXT[] as conflicts$$,
+ 'SELECT patch_name COLLATE "C", applied_tsz, applied_by COLLATE "C", requires, conflicts FROM _v.patches',
+ $$SELECT 'first_patch'::text COLLATE "C" as patch_name, now() as applied_tsz, current_user::TEXT COLLATE "C" as applied_by, '{}'::TEXT[] as requires, '{}'::TEXT[] as conflicts$$,
'Sanity check if patch is correctly saved.'
);
@@ -67,5 +67,7 @@ BEGIN;
'De-Installation of patch.'
);
+ SELECT * FROM finish();
+
ROLLBACK;