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