X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcomp%2Fuse.t;h=fb597770d0a8da4db3431c1917b6d62820e38257;hb=501e7c3490d3750cf17f3dfec24af9ede34f3eb1;hp=1099547393cb2d67a75df24a7e79b31547cbfa1d;hpb=93430cb427caeba01ba89b008008b46159a7c165;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/comp/use.t b/t/comp/use.t index 1099547..fb59777 100755 --- a/t/comp/use.t +++ b/t/comp/use.t @@ -2,12 +2,18 @@ BEGIN { chdir 't' if -d 't'; - unshift @INC, '../lib'; + @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"; +}