|
plan tests => 6;
my $project_path = path( $Bin , 'data' , 'chapter3' );
my $results_path = path( $project_path , 'amcpresults' );
my $am = Algorithm::AM->new(
$project_path ,
commas => 'no' ,
);
$am ->classify(
endhook => \ &endhook ,
);
unlink $results_path
if -e $results_path ;
sub endhook {
test_bigcmp( @_ );
}
sub test_bigcmp {
my ( $am , $data ) = @_ ;
my ( $a , $b ) = @{ $am ->{sum}}[1,2];
is( "$a" , '4' , 'compare 9' );
is( "$b" , '9' , 'and 4' );
is(bigcmp( $a , $b ), -1, '4 is smaller than 9' );
is(bigcmp( $b , $a ), 1, '9 is bigger than 4' );
is(bigcmp( $a , $a ), 0, '9 is equal to 9' );
}
|