diff --git a/S32-str/sprintf.t b/S32-str/sprintf.t index 31b7dc3045..591bef89f5 100644 --- a/S32-str/sprintf.t +++ b/S32-str/sprintf.t @@ -199,19 +199,6 @@ is sprintf('%f', 2.718281828459), sprintf('%.6f', 2.718281828459), '%f defaults is sprintf('%g', 2.718281828459), sprintf('%.6g', 2.718281828459), '%g defaults to .6'; is sprintf('%G', 2.718281828459), sprintf('%.6G', 2.718281828459), '%G defaults to .6'; -# I don't know about the wisdom of these, but this is how Perl 5 handles it -#?rakudo.jvm 10 skip "Issues with Inf: RT #116280" -is sprintf('%e', Inf), "Inf", 'Inf properly handled %e'; -is sprintf('%E', Inf), "Inf", 'Inf properly handled %E'; -is sprintf('%f', Inf), "Inf", 'Inf properly handled %f'; -is sprintf('%g', Inf), "Inf", 'Inf properly handled %g'; -is sprintf('%G', Inf), "Inf", 'Inf properly handled %G'; -is sprintf('%e', -Inf), "-Inf", '-Inf properly handled %e'; -is sprintf('%E', -Inf), "-Inf", '-Inf properly handled %E'; -is sprintf('%f', -Inf), "-Inf", '-Inf properly handled %f'; -is sprintf('%g', -Inf), "-Inf", '-Inf properly handled %g'; -is sprintf('%G', -Inf), "-Inf", '-Inf properly handled %G'; - # L dies-ok(sub {my $x = sprintf('%n', 1234)}, '%n dies (Perl 5 compatibility)'); #OK not used dies-ok(sub {my $x = sprintf('%p', 1234)}, '%p dies (Perl 5 compatibility)'); #OK not used @@ -233,12 +220,22 @@ is map({chars sprintf "[%18s]\n", "ಠ" x $_ }, 0..6), [21, 21, 21, 21, is Date.new(-13_000_000_000, 1, 1), '-13000000000-01-01', 'RT #114760'; # RT #116280 -#?rakudo.jvm skip "java.lang.NumberFormatException: RT#116280" { is sprintf('%12.5f', NaN), ' NaN', 'RT #116280'; #?niecza 2 todo "https://github.com/sorear/niecza/issues/181" is sprintf('%12.5f', Inf), ' Inf', 'RT #116280'; is sprintf('%12.5f', -Inf), ' -Inf', 'RT #116280'; + + is sprintf('% 6e', Inf), " Inf", 'Inf properly handled %e'; + is sprintf('%+6E', Inf), " +Inf", 'Inf properly handled %E'; + is sprintf('%6f', Inf), " Inf", 'Inf properly handled %f'; + is sprintf('%+6g', Inf), " +Inf", 'Inf properly handled %g'; + is sprintf('% 6G', Inf), " Inf", 'Inf properly handled %G'; + is sprintf('%e', -Inf), "-Inf", '-Inf properly handled %e'; + is sprintf('%E', -Inf), "-Inf", '-Inf properly handled %E'; + is sprintf('%f', -Inf), "-Inf", '-Inf properly handled %f'; + is sprintf('%g', -Inf), "-Inf", '-Inf properly handled %g'; + is sprintf('%G', -Inf), "-Inf", '-Inf properly handled %G'; } # RT #106594, #62316, #74610