xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/run/switchI.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl -IFoo::Bar -IBla
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateBEGIN {
4*0Sstevel@tonic-gate    chdir 't' if -d 't';
5*0Sstevel@tonic-gate    unshift @INC, '../lib';
6*0Sstevel@tonic-gate    require './test.pl';	# for which_perl() etc
7*0Sstevel@tonic-gate}
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gateBEGIN {
10*0Sstevel@tonic-gate    plan(4);
11*0Sstevel@tonic-gate}
12*0Sstevel@tonic-gate
13*0Sstevel@tonic-gatemy $Is_MacOS = $^O eq 'MacOS';
14*0Sstevel@tonic-gatemy $Is_VMS   = $^O eq 'VMS';
15*0Sstevel@tonic-gatemy $lib;
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gate$lib = $Is_MacOS ? ':Bla:' : 'Bla';
18*0Sstevel@tonic-gateok(grep { $_ eq $lib } @INC);
19*0Sstevel@tonic-gateSKIP: {
20*0Sstevel@tonic-gate  skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
21*0Sstevel@tonic-gate  $lib = $Is_MacOS ? 'Foo::Bar:' : 'Foo::Bar';
22*0Sstevel@tonic-gate  ok(grep { $_ eq $lib } @INC);
23*0Sstevel@tonic-gate}
24*0Sstevel@tonic-gate
25*0Sstevel@tonic-gate$lib = $Is_MacOS ? ':Bla2:' : 'Bla2';
26*0Sstevel@tonic-gatefresh_perl_is("print grep { \$_ eq '$lib' } \@INC", $lib,
27*0Sstevel@tonic-gate	      { switches => ['-IBla2'] }, '-I');
28*0Sstevel@tonic-gateSKIP: {
29*0Sstevel@tonic-gate  skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
30*0Sstevel@tonic-gate  $lib = $Is_MacOS ? 'Foo::Bar2:' : 'Foo::Bar2';
31*0Sstevel@tonic-gate  fresh_perl_is("print grep { \$_ eq '$lib' } \@INC", $lib,
32*0Sstevel@tonic-gate	        { switches => ['-IFoo::Bar2'] }, '-I with colons');
33*0Sstevel@tonic-gate}
34