10 my($blib, $blib_arch, $blib_lib, @blib_dirs);
13 rmdir foreach reverse (@_);
14 unlink "stderr" unless $^O eq 'MacOS';
20 mkdir $dir or die "Can't mkdir $dir: $!" if ! -d $dir;
28 $MacPerl::Architecture = $MacPerl::Architecture; # shhhhh
30 $blib_lib = ":blib:lib:";
31 $blib_arch = ":blib:lib:$MacPerl::Architecture:";
32 @blib_dirs = ($blib, $blib_lib, $blib_arch); # order
37 $blib_arch = "blib/arch";
38 $blib_lib = "blib/lib";
39 @blib_dirs = ($blib, $blib_arch, $blib_lib);
41 _cleanup( @blib_dirs );
44 use Test::More tests => 7;
47 ok( $@ =~ /Cannot find blib/, 'Fails if blib directory not found' );
49 _mkdirs( @blib_dirs );
53 local $SIG{__WARN__} = sub { $warnings = join '', @_ };
55 is( $warnings, '', 'use blib is nice and quiet' );
58 is( @INC, 3, '@INC now has 3 elements' );
59 is( $INC[2], '../lib', 'blib added to the front of @INC' );
62 # Unix syntax is accepted going in but it's not what comes out
63 # So we don't use catdir above
64 $blib_arch = 'blib.arch]';
65 $blib_lib = 'blib.lib]';
67 elsif ($^O ne 'MacOS')
69 $blib_arch = File::Spec->catdir("blib","arch");
70 $blib_lib = File::Spec->catdir("blib","lib");
74 ok( grep(m|\Q$blib_lib\E$|, @INC[0,1]) == 1, " $blib_lib in \@INC");
75 ok( grep(m|\Q$blib_arch\E$|, @INC[0,1]) == 1, " $blib_arch in \@INC");
77 END { _cleanup( @blib_dirs ); }