Perl-Toolchain-Gang / File-chdir

(Perl) a more sensible way to change directories

Home Page:http://search.cpan.org/dist/File-chdir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails t/newline.t on Cygwin [rt.cpan.org #72924]

opened this issue · comments

https://rt.cpan.org/Ticket/Display.html?id=72924

t/newline.t ....... Cannot chdir back to
/home/Kent/.cpanm/work/1322950286.4824/File-chdir-0.1006/t/testdir4908: No such
file or directory at
/home/Kent/.cpanm/work/1322950286.4824/File-chdir-0.1006/lib/File/chdir.pm line
21
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run


So running with a call to system("bash") immediately after the mkdir call gets
me this:

ls -laF t/
total 34
drwxr-xr-x+ 1 Kent None 0 Dec 4 11:16 ./
drwxr-xr-x+ 1 Kent None 0 Dec 4 11:11 ../
-rw-r--r-- 1 Kent None 1213 Nov 3 11:11 00-compile.t
-rw-r--r-- 1 Kent None 5421 Nov 3 11:11 array.t
-rw-r--r-- 1 Kent None 1059 Nov 3 11:11 chdir.t
-rw-r--r-- 1 Kent None 2933 Nov 3 11:11 delete-array.t
drwxr-xr-x+ 1 Kent None 0 Nov 3 11:11 lib/
-rw-r--r-- 1 Kent None 532 Nov 3 11:11 nested.t
-rw-r--r-- 1 Kent None 523 Dec 4 11:16 newline.t
drwxr-xr-x+ 1 Kent None 0 Dec 4 11:16 testdir2008
test/ #<-- line feed working
-rw-r--r-- 1 Kent None 1493 Nov 3 11:11 var.t

But trying to chdir/ls into it from shell fails:

ls "testdir2008^Mtest"
test: No such file or directory

The only solution I could find for this was:

my $Can_mkdir_With_Newline = mkdir $Test_Dir ;
eval { abs_path($Test_Dir) ; 1 } or undef $Can_mkdir_With_Newline;

because abs_path($Test_Dir) triggers "No such file or directory at t/newline.t
line 16"

I tried something like

my $Can_mkdir_With_Newline = mkdir $Test_Dir and eval { abs_path($Test_Dir) ; 1
};

But that mysteriously doesn't work as I expect it to, so my brain must be off
sleeping somewhere.