Cwd-utf8
view release on metacpan or search on metacpan
# Cleanup temporarily created files and directories
END {
use File::Path 2.06_06 qw(remove_tree);
remove_tree($test_root) or die "Unable to remove $test_root" if -d $test_root;
}
# Check utf8 and non-utf8 results
sub check_dirs {
my ($test, $utf8, $non_utf8) = @_;
my $utf8_encoded = encode_utf8($utf8);
my $non_utf8_decoded = decode_utf8($non_utf8, FB_CROAK | LEAVE_SRC);
plan tests => 3;
like $utf8 => qr/\/$unicode_dir$/, "$test found correct dir";
is $utf8_encoded => $non_utf8, "$test encoded utf8 dir matches non-utf8";
is $utf8 => $non_utf8_decoded, "$test utf8 dir matches decoded non-utf8";
}
plan tests => 9;
use Cwd;
my $currentdir = getcwd();
# Test getcwd, cwd, fastgetcwd, fastcwd
chdir("$test_root/$unicode_dir") or die "Couldn't chdir to $test_root/$unicode_dir: $!";
for my $test (qw(getcwd cwd fastgetcwd fastcwd)) {
( run in 0.490 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )