This repository has been archived on 2025-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/legacyworlds-server-data/db-structure/tests/dirty/000-dirty-tests-self-check/run-test.sql
Emmanuel BENOîT c18bdc2d1f Dirty SQL test system
* Added a system that allows "dirty" tests to be written. These tests
actually need to change the database, so a temporary test database must
be created to run them.
2012-01-14 09:02:24 +01:00

17 lines
380 B
PL/PgSQL

/*
* Dirty test system self-check
*
* Insert an address, it should exist during the main test.
*/
BEGIN;
SELECT no_plan( );
SELECT pg_advisory_lock( 1 );
SELECT diag_test_name( 'Dirty test system self-check - prepare.sql was executed' );
SELECT is( COUNT(*)::INT , 1 )
FROM users.addresses
WHERE address = 'prepare@example.org';
SELECT * FROM finish( );
ROLLBACK;