Skip to content

mock_all_from_stat needs to be able to handle an empty stat return. #1

@toddr

Description

@toddr

When perl gets a bad stat, _ is obliterated. You can see this with the below example.

$>perl -E'say "ok lib" if -e "/lib"; stat("/abcde"); say "ok" if -e _;' 
ok lib

In the same way, OFC needs to be able to handle an empty array return when a stat that's being handled by the mock sub is not present.

Right now this isn't supported.

$>perl -w -Mstrict '-MOverload::FileCheck=:all' -E'sub mock {return []}; mock_all_from_stat(\&mock); say -e "/abc"'
Stat array should contain exactly 13 values at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 633.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions