37 lines
No EOL
1.1 KiB
PL/PgSQL
37 lines
No EOL
1.1 KiB
PL/PgSQL
/*
|
|
* Unit tests for emp.resprio_update_set( )
|
|
*/
|
|
BEGIN;
|
|
/* Create a fake temporary table and insert some values */
|
|
CREATE TEMPORARY TABLE rprio_update(
|
|
_empire_id INT ,
|
|
_technology_name_id INT ,
|
|
_emptech_id TEXT ,
|
|
_emptech_priority INT
|
|
) ON COMMIT DROP;
|
|
INSERT INTO rprio_update
|
|
VALUES ( 1 , 1 , 'test' , 2 );
|
|
|
|
-- ***** TESTS BEGIN HERE *****
|
|
SELECT plan( 4 );
|
|
|
|
SELECT diag_test_name( 'emp.resprio_update_set() - Using a bad identifier - Return value' );
|
|
SELECT ok( NOT emp.resprio_update_set( 'bad identifier' , 3 ) );
|
|
SELECT diag_test_name( 'emp.resprio_update_set() - Using a bad identifier - Table contents' );
|
|
SELECT set_eq( $$
|
|
SELECT * FROM rprio_update
|
|
$$ , $$ VALUES(
|
|
1 , 1 , 'test' , 2
|
|
) $$ );
|
|
|
|
SELECT diag_test_name( 'emp.resprio_update_set() - Using a valid identifier - Return value' );
|
|
SELECT ok( emp.resprio_update_set( 'test' , 3 ) );
|
|
SELECT diag_test_name( 'emp.resprio_update_set() - Using a bad identifier - Table contents' );
|
|
SELECT set_eq( $$
|
|
SELECT * FROM rprio_update
|
|
$$ , $$ VALUES(
|
|
1 , 1 , 'test' , 3
|
|
) $$ );
|
|
|
|
SELECT * FROM finish( );
|
|
ROLLBACK; |