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/admin/040-functions/200-bugs/005-dump-emp-resources-view.sql

36 lines
968 B
MySQL
Raw Normal View History

/*
* Tests for bugs.dump_emp_resources_view
*/
BEGIN;
/*
* We need a resource type, an empire and the associated resource record.
*/
\i utils/strings.sql
\i utils/resources.sql
\i utils/accounts.sql
\i utils/naming.sql
\i utils/universe.sql
SELECT _create_resources( 1 , 'resource' );
SELECT _create_emp_names( 1 , 'empire' );
INSERT INTO emp.empires( name_id , cash )
VALUES ( _get_emp_name( 'empire1' ) , 0 );
INSERT INTO emp.resources(
empire_id , resource_name_id , empres_possessed , empres_owed
) VALUES (
_get_emp_name( 'empire1' ) , _get_string( 'resource1' ) , 1 , 2
);
/***** TESTS BEGIN HERE *****/
SELECT plan( 1 );
SELECT diag_test_name( 'bugs.dump_emp_resources_view - Contents' );
SELECT set_eq( $$
SELECT empire_id , resource_name , empres_possessed , empres_owed
FROM bugs.dump_emp_resources_view
$$ , $$ VALUES (
_get_emp_name( 'empire1' ) , 'resource1' , 1 , 2
) $$ );
SELECT * FROM finish( );
ROLLBACK;