1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!./perl
BEGIN {
chdir 't' if -d 't';
unshift @INC, "../lib";
}
print "1..14\n";
my $test = 1;
use v5.5.640;
require v5.5.640;
print "ok $test\n"; ++$test;
print "not " unless v1.20.300.4000 eq "\x{1}\x{14}\x{12c}\x{fa0}";
print "ok $test\n"; ++$test;
print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%vd", v1.22.333.4444) eq '1.22.333.4444';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.14D.115C';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%*vb", "##", v1.22.333.4444)
eq '1##10110##101001101##1000101011100';
print "ok $test\n"; ++$test;
{
use bytes;
print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108';
print "ok $test\n"; ++$test;
print "not " unless
sprintf("%vd", v1.22.333.4444) eq '1.22.197.141.225.133.156';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.C5.8D.E1.85.9C';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154';
print "ok $test\n"; ++$test;
print "not " unless sprintf("%*vb", "##", v1.22.333.4444)
eq '1##10110##11000101##10001101##11100001##10000101##10011100';
print "ok $test\n"; ++$test;
}
|