summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-06 13:56:45 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-06 13:56:45 +0000
commit3cb0bbe5af1ac1b0e46bbee66b7b457629e7ffa3 (patch)
tree53e06029d69787129e9b2245a4648e61fcdb73e1 /t
parentc4410b1b816ab84616660ccfbce83a639eb24398 (diff)
downloadperl-3cb0bbe5af1ac1b0e46bbee66b7b457629e7ffa3.tar.gz
support sprintf("v%v", v1.2.3) (works on any string argument, in
fact); add tests for version tuples p4raw-id: //depot/perl@4998
Diffstat (limited to 't')
-rwxr-xr-xt/op/ver.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/op/ver.t b/t/op/ver.t
new file mode 100755
index 0000000000..e05264682c
--- /dev/null
+++ b/t/op/ver.t
@@ -0,0 +1,33 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, "../lib";
+}
+
+print "1..6\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 v1.20.300.4000 > 1.0203039 and v1.20.300.4000 < 1.0203041;
+print "ok $test\n"; ++$test;
+
+print "not " unless sprintf("%v", "Perl") eq '80.101.114.108';
+print "ok $test\n"; ++$test;
+
+print "not " unless sprintf("%v", v1.22.333.4444) eq '1.22.333.4444';
+print "ok $test\n"; ++$test;
+
+{
+ use byte;
+ print "not " unless
+ sprintf("%v", v1.22.333.4444) eq '1.22.197.141.225.133.156';
+ print "ok $test\n"; ++$test;
+}