Skip to content

Commit

Permalink
Move tests for RT #116280 to existing block
Browse files Browse the repository at this point in the history
Also make tests a bit more varied and unfudge for rakudo.jvm
  • Loading branch information
usev6 committed Nov 11, 2015
1 parent 5c7ae5c commit 53e1022
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions S32-str/sprintf.t
Expand Up @@ -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<S32::Str/"Str"/"The special directive, %n does not work in Perl 6">
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
Expand All @@ -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
Expand Down

0 comments on commit 53e1022

Please sign in to comment.