-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpgxntool-test.source
More file actions
59 lines (59 loc) · 1.52 KB
/
pgxntool-test.source
File metadata and controls
59 lines (59 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
\i @abs_srcdir@/pgxntool/setup.sql
\i test/pgxntool/psql.sql
-- No status messages
\set QUIET true
-- Verbose error messages
\set VERBOSITY verbose
-- Revert all changes on failure.
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true
BEGIN;
\i test/pgxntool/tap_setup.sql
\i test/pgxntool/psql.sql
-- No status messages
\set QUIET true
-- Verbose error messages
\set VERBOSITY verbose
-- Revert all changes on failure.
\set ON_ERROR_ROLLBACK 1
\set ON_ERROR_STOP true
SET client_min_messages = WARNING;
DO $$
BEGIN
IF NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname='tap') THEN
CREATE SCHEMA tap;
END IF;
END$$;
SET search_path = tap, public;
CREATE EXTENSION IF NOT EXISTS pgtap SCHEMA tap;
SET client_min_messages = NOTICE;
\pset format unaligned
\pset tuples_only true
\pset pager
-- vi: expandtab ts=2 sw=2
\i test/deps.sql
-- IF NOT EXISTS will emit NOTICEs, which is annoying
SET client_min_messages = WARNING;
-- Add any test dependency statements here
-- Note: pgTap is loaded by setup.sql
--CREATE EXTENSION IF NOT EXISTS ...;
/*
* Now load our extension. We don't use IF NOT EXISTs here because we want an
* error if the extension is already loaded (because we want to ensure we're
* getting the very latest version).
*/
CREATE EXTENSION "pgxntool-test";
-- Re-enable notices
SET client_min_messages = NOTICE;
SELECT plan(1);
1..1
SELECT is(
"pgxntool-test"(1,2)
, 3
);
ok 1
\i @abs_srcdir@/pgxntool/finish.sql
SELECT finish();
\echo # TRANSACTION INTENTIONALLY LEFT OPEN!
# TRANSACTION INTENTIONALLY LEFT OPEN!
-- vi: expandtab ts=2 sw=2