summaryrefslogtreecommitdiff
path: root/t/comp/require.t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-24 04:02:35 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-24 04:02:35 +0000
commita7cb1f9979dd83ab32266dc555f72f0939829c3f (patch)
tree30e708b7b59c1b8455a51a5b82a59ea9312de117 /t/comp/require.t
parentc63481edeb5a500b5e56c74ce83175790d2adf8a (diff)
downloadperl-a7cb1f9979dd83ab32266dc555f72f0939829c3f.tar.gz
support for v5.5.640 style version numbers
p4raw-id: //depot/utfperl@4705
Diffstat (limited to 't/comp/require.t')
-rwxr-xr-xt/comp/require.t52
1 files changed, 51 insertions, 1 deletions
diff --git a/t/comp/require.t b/t/comp/require.t
index 581dcba75c..d4c9d8ca61 100755
--- a/t/comp/require.t
+++ b/t/comp/require.t
@@ -7,7 +7,7 @@ BEGIN {
# don't make this lexical
$i = 1;
-print "1..4\n";
+print "1..16\n";
sub do_require {
%INC = ();
@@ -23,6 +23,56 @@ sub write_file {
close REQ;
}
+# new style version numbers
+
+eval { require v5.5.630; };
+print "# $@\nnot " if $@;
+print "ok ",$i++,"\n";
+
+eval { require v10.0.2; };
+print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/;
+print "ok ",$i++,"\n";
+
+eval q{ use v5.5.630; };
+print "# $@\nnot " if $@;
+print "ok ",$i++,"\n";
+
+eval q{ use v10.0.2; };
+print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/;
+print "ok ",$i++,"\n";
+
+my $ver = v5.5.630;
+eval { require $ver; };
+print "# $@\nnot " if $@;
+print "ok ",$i++,"\n";
+
+$ver = v10.0.2;
+eval { require $ver; };
+print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/;
+print "ok ",$i++,"\n";
+
+print "not " unless v5.5.1 gt v5.5;
+print "ok ",$i++,"\n";
+
+print "not " unless 5.005_01 > v5.5;
+print "ok ",$i++,"\n";
+
+print "not " unless 5.005_64 - v5.5.640 < 0.0000001;
+print "ok ",$i++,"\n";
+
+{
+ use utf8;
+ print "not " unless v5.5.640 eq "\x{5}\x{5}\x{280}";
+ print "ok ",$i++,"\n";
+
+ print "not " unless v7.15 eq "\x{7}\x{f}";
+ print "ok ",$i++,"\n";
+
+ print "not "
+ unless v1.20.300.4000.50000.600000 eq "\x{1}\x{14}\x{12c}\x{fa0}\x{c350}\x{927c0}";
+ print "ok ",$i++,"\n";
+}
+
# interaction with pod (see the eof)
write_file('bleah.pm', "print 'ok $i\n'; 1;\n");
require "bleah.pm";