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