From 1422520e23a64abea9ba62b08f1ed23a201b672d Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Wed, 11 Jun 2025 17:32:01 -0500 Subject: [PATCH] Add missing test files --- test/expected/install.out | 9 +++++++++ test/sql/install.sql | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 test/expected/install.out create mode 100644 test/sql/install.sql diff --git a/test/expected/install.out b/test/expected/install.out new file mode 100644 index 0000000..ae61611 --- /dev/null +++ b/test/expected/install.out @@ -0,0 +1,9 @@ +\set ECHO none +ok 1 - drop extension test_factory_pgtap +ok 2 - drop extension test_factory +ok 3 - Extension test_factory should not exist +ok 4 - Extension test_factory_pgtap should not exist +ok 5 - create extension +ok 6 - Function tf.tap(text, text) should exist +ok 7 - clean-up test_factory_pgtap +ok 8 - clean-up test_factory diff --git a/test/sql/install.sql b/test/sql/install.sql new file mode 100644 index 0000000..ae58bf3 --- /dev/null +++ b/test/sql/install.sql @@ -0,0 +1,30 @@ +\set ECHO none +\i test/helpers/setup.sql + +SET client_min_messages = WARNING; + +/* + * DO NOT use CASCADE here; we want this to fail if there's anything installed + * that depends on it. + */ +SELECT lives_ok($$DROP EXTENSION IF EXISTS test_factory_pgtap$$, 'drop extension test_factory_pgtap'); +SELECT lives_ok($$DROP EXTENSION IF EXISTS test_factory$$, 'drop extension test_factory'); + +SELECT hasnt_extension( 'test_factory' ); +SELECT hasnt_extension( 'test_factory_pgtap' ); + +SELECT lives_ok($$CREATE EXTENSION test_factory_pgtap CASCADE$$, 'create extension'); +COMMIT; + +SELECT has_function('tf', 'tap', array['text','text']); + +-- Cleanup +SELECT lives_ok($$DROP EXTENSION IF EXISTS test_factory_pgtap$$, 'clean-up test_factory_pgtap'); +SELECT lives_ok($$DROP EXTENSION IF EXISTS test_factory$$, 'clean-up test_factory'); + +/* + * Arguably we should cleanup pgtap and the tap schema... + */ + +-- vi: expandtab ts=2 sw=2 +