From 65c97e0fa99ead017678d8a15d6f6e7f4892eb97 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Tue, 11 Jul 2000 21:17:35 +0000 Subject: windows build tweaks (op/sprintf.t still fails tests 120-121, 149) p4raw-id: //depot/perl@6375 --- t/op/sprintf.t | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 't/op/sprintf.t') diff --git a/t/op/sprintf.t b/t/op/sprintf.t index 50b4c77dfe..0c2400c1a7 100755 --- a/t/op/sprintf.t +++ b/t/op/sprintf.t @@ -21,9 +21,9 @@ print '1..', scalar @tests, "\n"; $SIG{__WARN__} = sub { if ($_[0] =~ /^Invalid conversion/) { - $w = ' INVALID' + $w = ' INVALID' } else { - warn @_; + warn @_; } }; @@ -34,17 +34,26 @@ for ($i = 1; @tests; $i++) { $x = sprintf(">$template<", defined @$evalData ? @$evalData : $evalData); substr($x, -1, 0) = $w if $w; - ($y = $x) =~ s/([Ee][-+])0(\d)/$1$2/g; # $y has 3 exponent digits, not 2 + # $y may have 3 exponent digits, not 2 + my $r; + if (($y = $x) =~ s/([Ee][-+])0(\d)/$1$2/g) { + $y =~ s/^>\s+/>/; + $y =~ s/\s+<$/$result<") { print "ok $i\n"; } - elsif ($y eq ">$result<") # Some C libraries always give - { # three-digit exponent - print("ok $i >$result< $x # three-digit exponent accepted\n"); - } + elsif ($r and $y eq ">$r<") # Some C libraries always give + { # three-digit exponent + print("ok $i >$result< $x # three-digit exponent accepted\n"); + } else { - print("not ok $i >$template< >$data< >$result< $x", - $comment ? " # $comment\n" : "\n"); + print("not ok $i >$template< >$data< >$result< $x", + $comment ? " # $comment\n" : "\n"); } } -- cgit v1.2.1