On Thu, 28 Jul 2005 10:58:50 +0100, Nicholas Clark <[EMAIL PROTECTED]> wrote:
> On Thu, Jul 28, 2005 at 11:07:37AM +0200, H.Merijn Brand wrote: > > > And, knowing that it fails on those platforms, what do you want to do with > > it? Skip or TODO? I can assure you that no changes will be made for libc > > in HP-UX 11.00 or below, so the 10.20 failure will stay there till the > > end of times (unless we work around it in the perl source, which is not > > worth the trouble if you want my opinion) > > I think the best we can do is document it as "this isn't portable" and leave > it at that. The behaviour of negative floating point zero is platform > specific. For starters, it assumes that your platform's floating point can > represent it. > > Heck, there was a thread a year or two back on perl6-internals where it > turned out that the precise choice of CPU instructions by the compiler on > one platform affected whether a particular C construction produced positive > or negative floating point zero. This was the vendor compiler, not gcc. OK, here's my suggestion. The comments in the list of tests can now control the skip behaviour of the test. The patch enables almost all previously commented out tests, and adds the one Dominic suggested. I have tested this on HP-UX 10.20, HP-UX 11.00, HP-UX 11.11, AIX 4.3.3, AIX 5.2, and SuSE 9.2 & 9.3 ok 145 ok 146 ok 147 # skip No minus, failure expected on hpux 10.20 ok 148 --- t/op/sprintf.t 2005-07-18 15:08:05 +0200 +++ /tmp/sprintf.t 2005-07-28 12:21:22 +0200 @@ -11,8 +11,7 @@ BEGIN { @INC = '../lib'; } use warnings; -# we do not load %Config since this test resides in op and needs -# to run under the minitest target even without Config.pm working. +use Config; # strictness my @tests = (); @@ -85,9 +84,24 @@ for ($i = 1; @tests; $i++) { } } + my $skip = 0; + if ($comment =~ s/\s+skip:\s*(.*)//) { + my $os = $1; + if ($os =~ /\ball\b/i) { # >comment skip: all< + $skip = 1; + } elsif ($os =~ /\b$^O(?::(\S+))?\b/i) { # >comment skip: VMS hpux:10.20< + (my $vsn = $1 // "") =~ s/^(\d+(\.\d+)?).*/$1/; + $vsn && $Config{osvers} <= $vsn and $skip = 1; + } + $skip and $comment =~ s/$/, failure expected on $^O $Config{osvers}/; + } + if ($x eq ">$result<") { print "ok $i\n"; } + elsif ($skip) { + print "ok $i # skip $comment\n"; + } elsif ($y eq ">$result<") # Some C libraries always give { # three-digit exponent print("ok $i # >$result< $x three-digit exponent accepted\n"); @@ -125,15 +139,8 @@ for ($i = 1; @tests; $i++) { =begin problematic ->%.0f< >-0.1< >-0< >C library bug: no minus on VMS, HP-UX< >%.0f< >1.5< >2< >Standard vague: no rounding rules< >%.0f< >2.5< >2< >Standard vague: no rounding rules< ->%G< >1234567e96< >1.23457E+102< >exponent too big for OS/390< ->%G< >.1234567e-101< >1.23457E-102< >exponent too small for OS/390< ->%e< >1234567E96< >1.234567e+102< >exponent too big for OS/390< ->%e< >.1234567E-101< >1.234567e-102< >exponent too small for OS/390< ->%g< >.1234567E-101< >1.23457e-102< >exponent too small for OS/390< ->%g< >1234567E96< >1.23457e+102< >exponent too big for OS/390< =end problematic @@ -154,6 +161,8 @@ __END__ >%G< >1234567e96< >1.23457E+102< >%G< >.1234567e-101< >1.23457E-102< >%G< >12345.6789< >12345.7< +>%G< >1234567e96< >1.23457E+102< >exponent too big skip: os390< +>%G< >.1234567e-101< >1.23457E-102< >exponent too small skip: os390< >%H< >''< >%H INVALID< >%I< >''< >%I INVALID< >%J< >''< >%J INVALID< @@ -250,6 +259,8 @@ __END__ >%+12.4e< >1234.875< > +1.2349e+03< >%+-12.4e< >-1234.875< >-1.2349e+03 < >%+12.4e< >-1234.875< > -1.2349e+03< +>%e< >1234567E96< >1.234567e+102< >exponent too big skip: os390< +>%e< >.1234567E-101< >1.234567e-102< >exponent too small skip: os390< >%f< >1234.875< >1234.875000< >%+f< >1234.875< >+1234.875000< >%#f< >1234.875< >1234.875000< @@ -258,6 +269,7 @@ __END__ >%#f< >-1234.875< >-1234.875000< >%6f< >1234.875< >1234.875000< >%*f< >[6, 1234.875]< >1234.875000< +>%.0f< >-0.1< >-0< >C library bug: no minus skip: VMS< >%.0f< >1234.875< >1235< >%.1f< >1234.875< >1234.9< >%-8.1f< >1234.875< >1234.9 < @@ -282,6 +294,7 @@ __END__ >%g< >12345.6789< >12345.7< >%+g< >12345.6789< >+12345.7< >%#g< >12345.6789< >12345.7< +>%.0g< >-0.0< >-0< >No minus skip: VMS hpux:10.20< >%.0g< >12345.6789< >1e+04< >%#.0g< >12345.6789< >1.e+04< >%.2g< >12345.6789< >1.2e+04< @@ -307,8 +320,10 @@ __END__ >%g< >0< >0< >%13g< >1234567.89< > 1.23457e+06< >%+13g< >1234567.89< > +1.23457e+06< ->%013g< >1234567.89< >001.23457e+06< ->%-13g< >1234567.89< >1.23457e+06 < +>%013g< >1234567.89< >001.23457e+06< +>%-13g< >1234567.89< >1.23457e+06 < +>%g< >.1234567E-101< >1.23457e-102< >exponent too small skip: os390< +>%g< >1234567E96< >1.23457e+102< >exponent too big skip: os390< >%h< >''< >%h INVALID< >%i< >123456.789< >123456< >Synonym for %d< >%j< >''< >%j INVALID< -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2 on HP-UX 10.20, 11.00 & 11.11, AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org, perl QA: http://qa.perl.org reports to: [EMAIL PROTECTED], perl-qa@perl.org