cpanel / Overload-FileCheck

Overload XS file test operators - see perldoc -X
7 stars 7 forks source link

file() with undef contents makes -e report EBADF #13

Open FGasper opened 5 years ago

FGasper commented 5 years ago

To correctly mock nonexistence of a file, -e should set $! to ENOENT, not EBADF. Otherwise logic that does due diligence and reports non-ENOENT failures after a -e check will report a failure.

FGasper commented 5 years ago
> perl -MTest::MockFile -e'my $mf = Test::MockFile->file("/some/path", undef); -e "/some/path"; print "$!"'
Bad file descriptor
toddr commented 5 years ago

Hmm.... This might not be a bug in T::MF it might be https://github.com/CpanelInc/Overload-FileCheck/issues but I'll check.

Actually on more reflection, I'm 99% certain it's an Overload issue.

atoomic commented 2 years ago

with the release of Overload-FileCheck v0.12 and the last version of Test-MockFile (installed from master)

> perl -MTest::MockFile -e'my $mf = Test::MockFile->file("/some/path", undef); -e "/some/path"; print "$!"'
No such file or director

So I think this is fixed need to wait and confirm for the release of both