use Cwd qw(abs_path cwd);
use File::Spec::Functions qw(:DEFAULT splitdir);
-use Test::More tests => 24;
+use Test::More tests => 25;
my $cwd = abs_path;
delete @ENV{@magic_envs};
local $ENV{$key} = catdir $cwd, 'op';
+ # Make sure $ENV{'SYS$LOGIN'} is only honored on VMS.
if( $key eq 'SYS$LOGIN' && $^O ne 'VMS' ) {
- # Make sure $ENV{'SYS$LOGIN'} is only honored on VMS.
- ok( !chdir(), "chdir() w/\$ENV{$key} set" );
- is( abs_path, $cwd, ' abs_path() agrees' );
+ ok( !chdir(), "chdir() on $^O ignores only \$ENV{$key} set" );
+ is( abs_path, $cwd, ' abs_path() did not change' );
+ ok( 1, " no need to chdir back on $^O" );
}
else {
- ok( chdir(), "chdir() w/\$ENV{$key} set" );
+ ok( chdir(), "chdir() w/ only \$ENV{$key} set" );
is( abs_path, $ENV{$key}, ' abs_path() agrees' );
chdir($cwd);
is( abs_path, $cwd, ' and back again' );
}
# Bug had chdir(undef) being the same as chdir()
- ok( !chdir(undef), "chdir(undef) w/\$ENV{$key} set" );
+ ok( !chdir(undef), "chdir(undef) w/ only \$ENV{$key} set" );
is( abs_path, $cwd, ' abs_path() agrees' );
# Ditto chdir('').
- ok( !chdir(''), "chdir('') w/\$ENV{$key} set" );
+ ok( !chdir(''), "chdir('') w/ only \$ENV{$key} set" );
is( abs_path, $cwd, ' abs_path() agrees' );
}