This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document upgrading a module in cpan/
[perl5.git] / t / run / switchI.t
1 #!./perl -IFoo::Bar -IBla
2
3 BEGIN {
4     chdir 't' if -d 't';
5     unshift @INC, '../lib';
6     require './test.pl';        # for which_perl() etc
7     plan(4);
8 }
9
10 my $Is_VMS   = $^O eq 'VMS';
11 my $lib;
12
13 $lib = 'Bla';
14 ok(grep { $_ eq $lib } @INC[0..($#INC-1)]);
15 SKIP: {
16   skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
17   $lib = 'Foo::Bar';
18   ok(grep { $_ eq $lib } @INC[0..($#INC-1)]);
19 }
20
21 $lib = 'Bla2';
22 fresh_perl_is("print grep { \$_ eq '$lib' } \@INC[0..(\$#INC-1)]", $lib,
23               { switches => ['-IBla2'], nolib => 1 }, '-I');
24 SKIP: {
25   skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
26   $lib = 'Foo::Bar2';
27   fresh_perl_is("print grep { \$_ eq '$lib' } \@INC", $lib,
28                 { switches => ['-IFoo::Bar2'], nolib => 1 }, '-I with colons');
29 }