10 my($blib, $blib_arch, $blib_lib, @blib_dirs);
12 my $Is_VMS = $^O eq 'VMS';
16 require VMS::Filespec if $Is_VMS;
20 if (eval 'require VMS::Feature') {
21 $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
23 my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
24 $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
26 $Is_VMS_mode = 0 if ($vms_unix_rpt);
31 rmdir foreach reverse (@_);
38 mkdir $dir or die "Can't mkdir $dir: $!" if ! -d $dir;
45 $blib_arch = "blib/arch";
46 $blib_lib = "blib/lib";
47 @blib_dirs = ($blib, $blib_arch, $blib_lib);
48 _cleanup( @blib_dirs );
51 use Test::More tests => 7;
54 ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not found' );
56 _mkdirs( @blib_dirs );
60 local $SIG{__WARN__} = sub { $warnings = join '', @_ };
62 is( $warnings, '', 'use blib is nice and quiet' );
65 is( @INC, 3, '@INC now has 3 elements' );
66 is( $INC[2], '../lib', 'blib added to the front of @INC' );
69 # Unix syntax is accepted going in but it's not what comes out
70 # So we don't use catdir above
71 $blib_arch = 'blib.arch]';
72 $blib_lib = 'blib.lib]';
76 $blib_arch = File::Spec->catdir("blib","arch");
77 $blib_lib = File::Spec->catdir("blib","lib");
81 ok( grep(m|\Q$blib_lib\E$|, @INC[0,1]) == 1, " $blib_lib in \@INC");
82 ok( grep(m|\Q$blib_arch\E$|, @INC[0,1]) == 1, " $blib_arch in \@INC");
84 END { _cleanup( @blib_dirs ); }