This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Gisle noted an unused variable
[perl5.git] / t / op / sprintf2.t
CommitLineData
1d917b39
RGS
1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
7}
8
6c94ec8b 9plan tests => 3;
1d917b39
RGS
10
11is(
12 sprintf("%.40g ",0.01),
13 sprintf("%.40g", 0.01)." ",
14 q(the sprintf "%.<number>g" optimization)
15);
16is(
17 sprintf("%.40f ",0.01),
18 sprintf("%.40f", 0.01)." ",
19 q(the sprintf "%.<number>f" optimization)
20);
6c94ec8b
HS
21{
22 chop(my $utf8_format = "%-3s\x{100}");
23 is(
24 sprintf($utf8_format, "\xe4"),
25 "\xe4 ",
26 q(width calculation under utf8 upgrade)
27 );
28}