develooper Front page | perl.perl5.porters | Postings from January 2018

[perl #132648] Cwd: different return values between pure perl and XSvariants

Thread Previous | Thread Next
From:
slaven@rezic.de via RT
Date:
January 15, 2018 19:31
Subject:
[perl #132648] Cwd: different return values between pure perl and XSvariants
Message ID:
rt-4.0.24-4349-1516044685-1536.132648-15-0@perl.org
Dana Sun, 14 Jan 2018 18:32:28 -0800, tonyc reče:
> On Sun, Dec 24, 2017 at 11:15:47AM +0000, Zefram wrote:
> > Fixed in commit d2e38af7de734aa1e317de7166c6995e432e2f30.
> 
> This new test has been failing on cygwin since it was introduced.
> 
> tony@saturn ~/dev/perl/git/perl/t
> $ ./perl harness -v ../dist/PathTools/t/cwd_enoent.t
> ../dist/PathTools/t/cwd_enoent.t ..
> 1..8
> not ok 1 - regular getcwd result on non-existent directory
> #   Failed test 'regular getcwd result on non-existent directory'
> #   at t/cwd_enoent.t line 30.
> #          got: '/tmp/4WuHD3C4IY/testdir'
> #     expected: undef
> not ok 2 - regular getcwd errno on non-existent directory
> #   Failed test 'regular getcwd errno on non-existent directory'
> #   at t/cwd_enoent.t line 31.
> #          got: '0'
> #     expected: '2'
> .: No such file or directory at t/cwd_enoent.t line 33.
> # Looks like your test exited with 2 just after 2.
> .: No such file or directory at ../../lib/File/Temp.pm line 777.
> END failed--call queue aborted.
> Dubious, test returned 2 (wstat 512, 0x200)
> Failed 8/8 subtests
> 
> Test Summary Report
> -------------------
> ../dist/PathTools/t/cwd_enoent.t (Wstat: 512 Tests: 2 Failed: 2)
>   Failed tests:  1-2
>   Non-zero exit status: 2
>   Parse errors: Bad plan.  You planned 8 tests but ran 2.
> Files=1, Tests=2,  0 wallclock secs ( 0.00 usr  0.00 sys +  0.09 cusr
> 0.00 csys =  0.09 CPU)
> Result: FAIL
> 
> tony@saturn ~/dev/perl/git/perl/t
> $ git describe
> v5.27.7-132-g22803c6a19
> 

I guess that's because Cygwin's getcwd() is implemented with _backtick_pwd(), and Cygwin's pwd command behaves differently than on Unix --- in this situation it returns the non-existent directory.

Regards,
    Slaven


---
via perlbug:  queue: perl5 status: pending release
https://rt.perl.org/Ticket/Display.html?id=132648

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About