From 574c798aa09309489c549b50dff81b705c3afde8 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Wed, 30 Oct 2002 12:18:47 +0100 Subject: Re: [perl #18066] Bug in -I when path has double colons? Message-ID: <87of9c2prs.fsf@vran.herceg.de> With the corresponding change to embed.fnc p4raw-id: //depot/perl@18102 --- t/run/runenv.t | 24 +++++++++++++++++++++++- t/run/switchI.t | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 t/run/switchI.t (limited to 't/run') diff --git a/t/run/runenv.t b/t/run/runenv.t index 236f84eabb..317784ae31 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -16,7 +16,7 @@ BEGIN { use Test; -plan tests => 11; +plan tests => 15; my $STDOUT = './results-0'; my $STDERR = './results-1'; @@ -145,6 +145,28 @@ try({PERL5OPT => '-t'}, '1', ''); +try({PERLLIB => "foobar:42"}, + ['-e', 'print grep { $_ eq "foobar" } @INC'], + 'foobar', + ''); + +try({PERLLIB => "foobar:42"}, + ['-e', 'print grep { $_ eq "42" } @INC'], + '42', + ''); + +try({PERL5LIB => "foobar:42"}, + ['-e', 'print grep { $_ eq "foobar" } @INC'], + 'foobar', + ''); + +try({PERL5LIB => "foobar:42"}, + ['-e', 'print grep { $_ eq "42" } @INC'], + '42', + ''); + +# PERL5LIB tests with included arch directories still missing + END { 1 while unlink $STDOUT; 1 while unlink $STDERR; diff --git a/t/run/switchI.t b/t/run/switchI.t new file mode 100644 index 0000000000..fa74b9435e --- /dev/null +++ b/t/run/switchI.t @@ -0,0 +1,19 @@ +#!./perl -IFoo::Bar -IBla + +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib'; + require './test.pl'; # for which_perl() etc +} + +BEGIN { + plan(4); +} + +ok(grep { $_ eq 'Bla' } @INC); +ok(grep { $_ eq 'Foo::Bar' } @INC); + +fresh_perl_is('print grep { $_ eq "Bla2" } @INC', 'Bla2', + { switches => ['-IBla2'] }, '-I'); +fresh_perl_is('print grep { $_ eq "Foo::Bar2" } @INC', 'Foo::Bar2', + { switches => ['-IFoo::Bar2'] }, '-I with colons'); -- cgit v1.2.1