adjust for lost fp precision in require version check
[p5sagit/p5-mst-13.2.git] / t / op / ver.t
CommitLineData
3cb0bbe5 1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 unshift @INC, "../lib";
6}
7
44dcb63b 8print "1..14\n";
3cb0bbe5 9
10my $test = 1;
11
12use v5.5.640;
13require v5.5.640;
14print "ok $test\n"; ++$test;
15
16print "not " unless v1.20.300.4000 eq "\x{1}\x{14}\x{12c}\x{fa0}";
17print "ok $test\n"; ++$test;
18
b22c7a20 19print "not " unless sprintf("%vd", "Perl") eq '80.101.114.108';
3cb0bbe5 20print "ok $test\n"; ++$test;
21
b22c7a20 22print "not " unless sprintf("%vd", v1.22.333.4444) eq '1.22.333.4444';
23print "ok $test\n"; ++$test;
24
25print "not " unless sprintf("%vx", "Perl") eq '50.65.72.6c';
26print "ok $test\n"; ++$test;
27
28print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.14D.115C';
29print "ok $test\n"; ++$test;
30
31print "not " unless sprintf("%*v#o", ":", "Perl") eq '0120:0145:0162:0154';
32print "ok $test\n"; ++$test;
33
34print "not " unless sprintf("%*vb", "##", v1.22.333.4444)
35 eq '1##10110##101001101##1000101011100';
3cb0bbe5 36print "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}