From bbd6967b3d549a2e37beaf28fd6f68674f9322f2 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Wed, 22 Mar 2023 11:02:13 +0100 Subject: 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 --- t/op/sprintf2.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't') 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(); -- cgit v1.2.1