File: newline.t

package info (click to toggle)
libfile-chdir-perl 0.1006-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 168 kB
  • sloc: perl: 480; makefile: 50
file content (31 lines) | stat: -rw-r--r-- 491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env perl -w

use strict;
use warnings;

use Test::More;

use File::chdir;
use Cwd qw(abs_path);

my $Orig_Cwd = $CWD;

my $Test_Dir = "t/testdir$$\ntest";
my $Can_mkdir_With_Newline = mkdir $Test_Dir;

plan skip_all => "Can't make a directory with a newline in it" unless $Can_mkdir_With_Newline;

{
    local $CWD = $Test_Dir;
    is $CWD, abs_path;
}

is $CWD, $Orig_Cwd;
is abs_path, $Orig_Cwd;

END {
    chdir $Orig_Cwd;  # just in case
    rmdir $Test_Dir;
}

done_testing;