\i Infrastructure-TestHeader.sql

\echo '$Id: 0-integrity-CrossContestAliases.sql 95 2007-03-19 13:59:35Z dflater $'
\echo
\echo 'Verify that aliases that point to a candidate in a different contest'
\echo 'are detected by the integrity check.  The "All results should be'
\echo 'empty" notice does not apply to this test case.  Refer instead to'
\echo 'the "Expected results" printed at the bottom.'

\i 0-integrity-common.sql

-- 'INCUMBENT' is an alias for 'Mr. Fiscal' (bogus)
insert into Alias (ChoiceId, AliasId) values (4, 3);

-- Get rid of double votes that could confuse the tester.
delete from VoterInput where BallotId = 7;

\i Infrastructure-IntegrityChecks.sql

\echo 'Expected results:'
\echo '                             Cross Contest Aliases'
\echo ' aliasid | aliasname | aliascontestid | choiceid | choicename | choicecontestid '
\echo '---------+-----------+----------------+----------+------------+-----------------'
\echo '       3 | INCUMBENT |              1 |        4 | Mr. Fiscal |               2'
\echo '(1 row)'

\i Infrastructure-TestFooter.sql
