Acme-Spinodal-Utils
view release on metacpan or search on metacpan
{ # Expected total
my $total;
eval { $total = Acme::Spinodal::Utils::sum( qw(1 2 3 4) ) };
my $err = $@;
is( $total, 10, "Checking that the correct total is returned." );
is( $err, '', "Checking no error was returned.")
}
{ # Strange args
throws_ok { Acme::Spinodal::Utils::sum( qw( 1 2 3 Blarg!) ) } qr/does not appear to be a valid number!/, 'Checking an error was returned.';
}
{ # some more intersting numbers
my $total;
eval { $total = Acme::Spinodal::Utils::sum( qw( 5 -273.15 3.141592 12321 0 -12.34e56) ) };
my $err = $@;
is( $total, -1.234e+57, "Checking that the correct total is returned." );
is( $err, '', "Checking no error was returned.")
}
}
( run in 0.362 second using v1.01-cache-2.11-cpan-496ff517765 )