summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/comp/use.t
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/comp/use.t')
-rwxr-xr-xcontrib/perl5/t/comp/use.t79
1 files changed, 74 insertions, 5 deletions
diff --git a/contrib/perl5/t/comp/use.t b/contrib/perl5/t/comp/use.t
index a6ce2a4..1f5fae3 100755
--- a/contrib/perl5/t/comp/use.t
+++ b/contrib/perl5/t/comp/use.t
@@ -2,12 +2,18 @@
BEGIN {
chdir 't' if -d 't';
- @INC = '../lib';
+ unshift @INC, '../lib';
}
-print "1..14\n";
+print "1..27\n";
my $i = 1;
+eval "use 5.000"; # implicit semicolon
+if ($@) {
+ print STDERR $@,"\n";
+ print "not ";
+}
+print "ok ",$i++,"\n";
eval "use 5.000;";
if ($@) {
@@ -44,9 +50,7 @@ unless ($@) {
print "ok ",$i++,"\n";
-
-use lib; # I know that this module will be there.
-
+{ use lib } # check that subparse saves pending tokens
local $lib::VERSION = 1.0;
@@ -99,3 +103,68 @@ print "ok ",$i++,"\n";
print "not " if $INC[0] eq "freda";
print "ok ",$i++,"\n";
+
+{
+ local $lib::VERSION = 35.36;
+ eval "use lib v33.55";
+ print "not " if $@;
+ print "ok ",$i++,"\n";
+
+ eval "use lib v100.105";
+ unless ($@ =~ /lib version 100\.105 required--this is only version 35\.3/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+
+ eval "use lib 33.55";
+ print "not " if $@;
+ print "ok ",$i++,"\n";
+
+ eval "use lib 100.105";
+ unless ($@ =~ /lib version 100\.105 required--this is only version 35\.3/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+
+ local $lib::VERSION = '35.36';
+ eval "use lib v33.55";
+ print "not " if $@;
+ print "ok ",$i++,"\n";
+
+ eval "use lib v100.105";
+ unless ($@ =~ /lib version 100\.105 required--this is only version 35\.36/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+
+ eval "use lib 33.55";
+ print "not " if $@;
+ print "ok ",$i++,"\n";
+
+ eval "use lib 100.105";
+ unless ($@ =~ /lib version 100\.105 required--this is only version 35\.36/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+
+ local $lib::VERSION = v35.36;
+ eval "use lib v33.55";
+ print "not " if $@;
+ print "ok ",$i++,"\n";
+
+ eval "use lib v100.105";
+ unless ($@ =~ /lib v100\.105 required--this is only v35\.36/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+
+ eval "use lib 33.55";
+ print "not " if $@;
+ print "ok ",$i++,"\n";
+
+ eval "use lib 100.105";
+ unless ($@ =~ /lib version 100\.105 required--this is only version 35\.036/) {
+ print "not ";
+ }
+ print "ok ",$i++,"\n";
+}
OpenPOWER on IntegriCloud