1#!/usr/bin/perl -w 2 3use Test::Simple tests => 4; 4 5use Algorithm::Pair::Swiss; 6 7my $pairer = Algorithm::Pair::Swiss->new; 8 9$pairer->parties(1,2,3,4); 10 11my @pairs = $pairer->pairs; 12ok( @pairs == 2, 'two pairs for four parties'); 13 14$pairer->exclude(@pairs); 15@pairs = $pairer->pairs; 16ok( @pairs == 2, 'still two pairs after first exclusion'); 17 18$pairer->exclude(@pairs); 19@pairs = $pairer->pairs; 20ok( @pairs == 2, 'still two pairs after second exclusion'); 21 22$pairer->exclude(@pairs); 23@pairs = $pairer->pairs; 24ok( @pairs == 0, 'no more pairs after third exclusion'); 25 26