You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mocking a directory and a file in the same directory we can then see . and ..
but unfortunately we have no way to mock them and they should be also provided/mocked for free for us by the directory / file
$>perl foo.pl
Use of stat to access unmocked file or directory '/there/.' in strict mode at foo.pl line 8 at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/Test/MockFile.pm line 238.
Test::MockFile::_strict_mode_violation("stat", ARRAY(0xd4a360)) called at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/Test/MockFile.pm line 1150
Test::MockFile::_real_file_access_hook("stat", ARRAY(0xd4a360)) called at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/Test/MockFile.pm line 612
Test::MockFile::_mock_stat("stat", "/there/.") called at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 295
Overload::FileCheck::_check_from_stat("e", "/there/.", CODE(0xc2a408)) called at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 265
Overload::FileCheck::__ANON__("e", "/there/.") called at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 210
Overload::FileCheck::__ANON__("/there/.") called at /usr/local/cpanel/3rdparty/perl/532/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 586
Overload::FileCheck::_check(275, "/there/.") called at foo.pl line 8
The text was updated successfully, but these errors were encountered:
As I think we mock .. for free, it should exist and we should be able to open it.
If you try to open .. again then same behavior it should be mocked again and again... probably in a dynamic way.
Note that for example the following script show the same issue unmocked, you can keep looping forever on .. if you do not have the correct guards in place
When mocking a directory and a file in the same directory we can then see
.
and..
but unfortunately we have no way to mock them and they should be also provided/mocked for free for us by the directory / file
output
output
The text was updated successfully, but these errors were encountered: