Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-s 'relative/path' broken in strict mode. #26

Closed
toddr opened this issue Dec 20, 2018 · 1 comment
Closed

-s 'relative/path' broken in strict mode. #26

toddr opened this issue Dec 20, 2018 · 1 comment

Comments

@toddr
Copy link
Member

toddr commented Dec 20, 2018

$>perl -MData::Dumper -MTest::MockFile=strict -E'my $f = Test::MockFile->file( "t/data/example_email.csv", "blah" ); print Dumper \%Test::MockFile::files_being_mocked; -s "t/data/example_email.csv" && print "ok\n";'
$VAR1 = {
          '/usr/local/cpanel/t/data/example_email.csv' => bless( {
                                                                   'uid' => 0,
                                                                   'inode' => 0,
                                                                   'nlink' => 0,
                                                                   'dev' => 0,
                                                                   'gid' => 0,
                                                                   'contents' => 'blah',
                                                                   'tty' => 0,
                                                                   'rdev' => 0,
                                                                   'atime' => 1545326306,
                                                                   'mode' => 33188,
                                                                   'file_name' => '/usr/local/cpanel/t/data/example_email.csv',
                                                                   'blksize' => 4096,
                                                                   'readlink' => '',
                                                                   'mtime' => 1545326306,
                                                                   'fileno' => 900,
                                                                   'ctime' => 1545326306
                                                                 }, 'Test::MockFile' )
        };
Use of stat to access unmocked file or directory 't/data/example_email.csv' in strict mode at -e line 1 at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/Test/MockFile.pm line 170.
	Test::MockFile::_strict_mode_violation("stat", ARRAY(0x18cd280)) called at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/Test/MockFile.pm line 937
	Test::MockFile::_real_file_access_hook("stat", ARRAY(0x18cd280)) called at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/Test/MockFile.pm line 471
	Test::MockFile::_mock_stat("stat", "t/data/example_email.csv") called at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 295
	Overload::FileCheck::_check_from_stat("s", "t/data/example_email.csv", CODE(0x1a43fb0)) called at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 265
	Overload::FileCheck::__ANON__("s", "t/data/example_email.csv") called at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 210
	Overload::FileCheck::__ANON__("t/data/example_email.csv") called at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int/Overload/FileCheck.pm line 586
	Overload::FileCheck::_check(276, "t/data/example_email.csv") called at -e line 1

toddr added a commit that referenced this issue Dec 20, 2018
@toddr
Copy link
Member Author

toddr commented Dec 20, 2018

This is fixed in 0.014

@toddr toddr closed this as completed Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant