File: newline.t

package info (click to toggle)
libfile-chdir-perl 0.1008-1.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 482; makefile: 52
file content (31 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (3)
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(getcwd);

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, getcwd;
}

is $CWD, $Orig_Cwd;
is getcwd, $Orig_Cwd;

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

done_testing;