\i Infrastructure-TestHeader.sql

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

\i 0-integrity-common.sql

-- Self-referential aliases are stopped by a check constraint.
insert into Alias (AliasId, ChoiceId) values
  (3, 2),
  (2, 1);

-- Get rid of double votes and endorsed aliases that could confuse the
-- tester.
delete from VoterInput;
delete from Endorsement;

\i Infrastructure-IntegrityChecks.sql

\echo 'Expected results:'
\echo ' Double Indirect Aliases'
\echo ' aliasid | aliasedaliasid '
\echo '---------+----------------'
\echo '       3 |              2'
\echo '(1 row)'

\i Infrastructure-TestFooter.sql
