diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-02-18 13:22:13 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-02-18 13:22:13 +0000 |
commit | 8975a8c255049aa172fbac58615aa6b8f5076610 (patch) | |
tree | 97f22b24238467451db4000a259e25f9c8c25588 /t | |
parent | e67cea9b6f4e5e16535851ce33a456c282242f0d (diff) | |
download | perl-8975a8c255049aa172fbac58615aa6b8f5076610.tar.gz |
fix write test: -small_number may be displayed as 00.00 or -0.00
p4raw-id: //depot/perl@22337
Diffstat (limited to 't')
-rwxr-xr-x | t/op/write.t | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/t/op/write.t b/t/op/write.t index ae9f8a5b8a..52ba517d67 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -33,7 +33,7 @@ my @NumTests = ( 999.99499, '999.99', -100, '######' ], [ '@0#.##', 0, '000.00', 1, '001.00', 10, '010.00', - -0.0001, '-00.00' ], + -0.0001, qr/^[\-0]00\.00$/ ], ); @@ -486,8 +486,11 @@ for my $tref ( @NumTests ){ my $expected = shift @$tref; my $writeres = swrite( $writefmt, $val ); $nt++; - - print $expected eq $writeres + my $ok = ref($expected) + ? $writeres =~ $expected + : $writeres eq $expected; + + print $ok ? "ok $nt\n" : "not ok $nt\n# f=[$writefmt] exp=[$expected] got=[$writeres]\n"; } |