Hi there!
I'm trying to test a trigger/function pair that updates a timestamp and user on update.
Just getting started on pgTAP and perhaps this is a dumb question but in the code below shouldn't lives_ok raise an exception if there is no record with id = 1??
Does lives_ok actually execute the statement ?
Also, can I execute arbitrary SQL around tests, or is better to always wrap them in lives_ok/throws_ok?
BEGIN;
SELECT plan(2);
PREPARE updatedp AS UPDATE processor set name = 'YUCA' where id = 1;
SELECT lives_ok('updatedp', 'update a processor');
SELECT ok((SELECT updated_ts from processor where id = 1) != NULL, 'updated_ts is not null');
ROLLBACK;
Thanks in advance!
--
Alex