Suite of database functions to write TAP-emitting unit tests in psql scripts or xUnit-style test functions
Questions tagged [pgtap]
18 questions
0
votes
1 answer
How do I write tests in Perl with pgTAP?
http://pgtap.org/integration.html#perl mentions how to run the tests, but I cannot find an example of a Perl test case.
Do I have to get a DBI connection manually, run my commands on it, and check the results?
Does it even make sense to use Perl vs…

Robert
- 7,394
- 40
- 45
- 64
0
votes
1 answer
pgTAP syntax error with plpgsql but not with sql
This pgTAP test
BEGIN;
CREATE OR REPLACE FUNCTION test.testXUnitStyle() RETURNS SETOF TEXT AS $$
SELECT ok(4 * 5 = 20, 'math should work in postgres');
$$ LANGUAGE plpgsql;
SELECT * FROM runtests('test'::name);
gives me this syntax…

Robert
- 7,394
- 40
- 45
- 64
-1
votes
1 answer
Postgres: How Can I DRY up Multiple WHERE IN (a,b,c,...) Clauses?
In a programming language like Javascript, instead of doing:
['a', 'b', 'c', 'd'].map(...);
['a', 'b', 'c', 'd'].filter(...);
['a', 'b', 'c', 'd'].forEach(...);
I can do the following:
const names = ['a', 'b', 'c',…

machineghost
- 33,529
- 30
- 159
- 234