93ad1f38b8e48dde3063587c20c27de6259a49f3
[p5sagit/p5-mst-13.2.git] / t / op / ver.t
1 #!./perl
2
3 BEGIN {
4     chdir 't' if -d 't';
5     unshift @INC, "../lib";
6 }
7
8 print "1..14\n";
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
19 print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108';
20 print "ok $test\n";  ++$test;
21
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';
36 print "ok $test\n";  ++$test;
37
38 {
39     use bytes;
40     print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108';
41     print "ok $test\n";  ++$test;
42
43     print "not " unless
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';
58     print "ok $test\n";  ++$test;
59 }