Changeset 216 for trunk/t


Ignore:
Timestamp:
04/17/09 21:50:40 (15 years ago)
Author:
nanardon
Message:
  • add more tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/10Vote_DB.t

    r214 r216  
    4848            is($r->voting_count, 6, "can get voting count"); 
    4949            is($r->signing_count, 4, "can get signing count"); 
    50             my $res = $r->results_nonull; 
     50            my $res = $r->results; 
    5151            is($res->[0]->{value}, 'ch1', "winner is ch1"); 
    5252            is($res->[0]->{count}, 3, "winner has 3 voices"); 
     
    6363            f => {}, 
    6464        }, 
    65         test_count => 10, 
     65        test_count => 14, 
    6666        tests => sub { 
    6767            my ($r) = @_; 
     
    7676            is($res->[0]->{value}, 'ch1', "winner is ch1"); 
    7777            is($res->[0]->{count}, 3, "winner has 3 voices"); 
     78            ok($res->[0]->{abs_maj}, "winner has absolute majority"); 
     79            ok($res->[0]->{elected}, "winner is set as elected"); 
    7880            is(@$res, 4, "count of winners"); 
    7981            is($res->[3]->{count}, 0, "last has 0 voices"); 
     82            ok(!$res->[3]->{abs_maj}, "last has not absolute majority"); 
     83            ok(!$res->[3]->{elected}, "last is not set as elected"); 
    8084        } 
    8185    }, 
Note: See TracChangeset for help on using the changeset viewer.