diff options
author | Yves Orton <demerphq@gmail.com> | 2023-03-22 11:02:13 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-03-29 20:54:49 +0800 |
commit | bbd6967b3d549a2e37beaf28fd6f68674f9322f2 (patch) | |
tree | 0f57fd29e06528fbfdb49a46d9e48668b20689e2 /t | |
parent | ea35cd23e9d1405ff9dda3484cf2648c5332225e (diff) | |
download | perl-bbd6967b3d549a2e37beaf28fd6f68674f9322f2.tar.gz |
t/op/sprintf2 - TODO some failing tests for %g.
On HPUX none of the usual methods for doing high precision %g seem to
work:
Checking for an efficient way to convert floats to strings.
Trying sprintf...
sprintf() found.
sprintf length mismatch: Expected 55, got 38
...But sprintf didn't work as I expected.
Trying gconvert...
gconvert NOT found.
Trying gcvt...
gcvt() found.
gcvt length mismatch: Expected 55, got 38
...But gcvt didn't work as I expected.
*** WHOA THERE!!! ***
None of ( sprintf gconvert gcvt) seemed to work properly. I'll use sprintf.
So we can safely TODO these tests for now.
See: https://github.com/Perl/perl5/issues/20953#issuecomment-1478744988
and: https://github.com/Perl/perl5/issues/20953#issuecomment-1483814118
Fixes: #20953
And also some issues in: #20959
Diffstat (limited to 't')
-rw-r--r-- | t/op/sprintf2.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/op/sprintf2.t b/t/op/sprintf2.t index aa942df5fb..53f410c8b7 100644 --- a/t/op/sprintf2.t +++ b/t/op/sprintf2.t @@ -1189,6 +1189,8 @@ if($Config{nvsize} == 8) { or $^O eq 'VMS' or + $^O eq 'hpux' + or ($^O eq 'MSWin32' and $Config{cc} eq 'cl' and $Config{ccversion} =~ /^(\d+)/ and @@ -1215,9 +1217,13 @@ elsif($Config{nvtype} eq 'long double' && $Config{longdblkind} >= 5 && $Config{l } else { # IEEE-754 128-bit long double or __float128 - cmp_ok(sprintf("%.115g", 0.3), 'eq', + TODO: { + local $::TODO = 'Extended precision %g formatting' if $^O eq 'hpux'; + + cmp_ok(sprintf("%.115g", 0.3), 'eq', '0.299999999999999999999999999999999990370350278063820734720110287075363407309491758923059023800306022167205810546875', "sprintf( \"%.115g\", 0.3 ) renders correctly"); + } } done_testing(); |