I noticed there was an error report on CPAN for Number::Format 1.52
http://www.nntp.perl.org/group/perl.cpan.testers/350947
but I was unable to reproduce it. I looked at the round.t test script
which caused the problem, and couldn't imagine why it would fail. So
I decided to try converting it to Test::More, and emailed the
resulting script to the guy who reported the failure. Here's the test
script I came up with - it's my first Test::More script, so maybe one
of you will have some critique before I check it into CVS?
Also, are any of you able to reproduce that testing error?
use Test::More tests => 7;
BEGIN { use_ok('Number::Format', 'round') }
cmp_ok(round(123456.512), '==', 123456.51, "precision=0" );
cmp_ok(round(-1234567.509, 2), '==', -1234567.51, "negative thousandths" );
cmp_ok(round(-12345678.5, 2), '==', -12345678.5, "negative tenths" );
cmp_ok(round(-123456.78951, 4), '==', -123456.7895, "precision=4" );
cmp_ok(round(123456.78951, -2), '==', 123500, "precision=-2" );
is( round(1.005, 2), 1.01, "string-eq" );
--
Help bring back the San Jose Earthquakes - http://www.soccersiliconvalley.com/
|