This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Uncomment and fix up tests at the end of Storable's blessed.t
[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 }
8
9 BEGIN {
10     plan(4);
11 }
12
13 my $Is_VMS   = $^O eq 'VMS';
14 my $lib;
15
16 $lib = 'Bla';
17 ok(grep { $_ eq $lib } @INC[0..($#INC-1)]);
18 SKIP: {
19   skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
20   $lib = 'Foo::Bar';
21   ok(grep { $_ eq $lib } @INC[0..($#INC-1)]);
22 }
23
24 $lib = 'Bla2';
25 fresh_perl_is("print grep { \$_ eq '$lib' } \@INC[0..(\$#INC-1)]", $lib,
26               { switches => ['-IBla2'] }, '-I');
27 SKIP: {
28   skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
29   $lib = 'Foo::Bar2';
30   fresh_perl_is("print grep { \$_ eq '$lib' } \@INC", $lib,
31                 { switches => ['-IFoo::Bar2'] }, '-I with colons');
32 }