Condition Coverage

blib/lib/Test/MockFile.pm
Criterion Covered Total %
condition 137 244 56.1


and 3 conditions

line !l l&&!r l&&r condition
279 0 0 45 defined $command and defined $_file_arg_post->{$command}
282 22 0 23 $command eq "open" and ref $at_under_ref
22 21 2 $command eq "open" and ref $at_under_ref and scalar @$at_under_ref == 2
526 0 44 1 defined $filename and $filename =~ /^\*?(?:main::)?[<*&+>]*STD(?:OUT|IN|ERR)$/
533 1 0 0 $command ne "open" and $command ne "sysopen"
537 22 0 22 $command eq "open" and $at_under_ref->[1]
0 20 2 $command eq "open" and $at_under_ref->[1] and $at_under_ref->[1] =~ /&/
565 0 9 10 defined $context->{'filename'} and $context->{'filename'} =~ /$rule->{'file_rule'}/
590 0 34 0 defined $STRICT_MODE_STATUS and not $STRICT_MODE_STATUS & 4
34 0 0 defined $STRICT_MODE_STATUS and not $STRICT_MODE_STATUS & 4 and $STRICT_MODE_STATUS != $strict_mode
602 0 22 0 defined $opt and $opt eq "plugin"
639 0 0 70 defined $file and length $file
652 47 20 0 not defined $contents and @stats
670 20 40 7 defined $contents and $files_being_mocked{$dirname}
735 0 0 12 defined $file and length $file
830 0 0 46 defined $dirname and length $dirname
885 5 1 1 ref $opts eq "HASH" and $opts->{'mode'}
948 0 0 118 scalar @_ == 1 and ref $_[0]
1023 0 2 107 defined $file_or_fh and length $file_or_fh
1031 0 0 107 defined $file and defined bless( {}, 'A::BROKEN::SYMLINK' )
0 106 1 defined $file and defined bless( {}, 'A::BROKEN::SYMLINK' ) and $file eq bless( {}, 'A::BROKEN::SYMLINK' )
1032 0 0 106 defined $file and defined bless( {}, 'A::CIRCULAR::SYMLINK' )
0 105 1 defined $file and defined bless( {}, 'A::CIRCULAR::SYMLINK' ) and $file eq bless( {}, 'A::CIRCULAR::SYMLINK' )
1034 0 0 105 defined $file and length $file
1082 626 23 2 $depth and not $mock_object
1085 287 328 34 $mock_object and $mock_object->is_link
1111 1 1 657 defined $fh and length $fh
1311 2 0 0 $] < "5.019" and $^O eq 'darwin' || $^O =~ /bsd/i
1409 0 0 0 defined $readlink and ref $readlink
1428 952 0 78 defined $self->{'readlink'} && length $self->{'readlink'} && $self->{'mode'} & 40960
1556 2 0 5 scalar @_ == 2 and defined $time
2 0 5 scalar @_ == 2 and defined $time and $time =~ /^[0-9]+$/
1575 2 0 5 @_ == 2 and defined $time
2 0 5 @_ == 2 and defined $time and $time =~ /^[0-9]+$/
1594 2 0 5 @_ == 2 and defined $time
2 0 5 @_ == 2 and defined $time and $time =~ /^[0-9]+$/
1628 0 0 0 $code_ref and ref $code_ref eq "CODE"
1756 50 12 0 defined $_[0] and not ref $_[0]
1812 61 1 0 ref $file and ref $file eq "SCALAR"
1818 62 0 0 not $abs_path and $mode ne "|-"
62 0 0 not $abs_path and $mode ne "|-" and $mode ne "-|"
1848 22 3 3 not defined $mock_file->contents and grep {$mode eq $_;} "<", "+<"
1917 1 2 0 ($sysopen_mode & 131072) == 131072 and $mock_file->is_link
1923 2 0 1 $sysopen_mode & 128 and $sysopen_mode & 64
2 1 0 $sysopen_mode & 128 and $sysopen_mode & 64 and defined $mock_file->{'contents'}
1929 2 0 1 $sysopen_mode & 64 and not defined $mock_file->{'contents'}
1934 2 0 1 $sysopen_mode & 512 and defined $mock_file->{'contents'}
1947 3 0 0 not defined $mock_file->{'contents'} and $rd_wr_mode == 0
1977 23 0 1 defined $_[0] and not ref $_[9]
2026 0 0 28 defined $_[0] and not ref $_[9]
2067 0 0 4 defined $_[0] and not ref $_[9]
2072 0 0 4 $mocked_dir and $mocked_dir->{'obj'}
2094 0 0 1 defined $_[0] and not ref $_[9]
2099 0 0 1 $mocked_dir and $mocked_dir->{'obj'}
2122 0 0 1 defined $_[0] and not ref $_[9]
2127 0 0 1 $mocked_dir and $mocked_dir->{'obj'}
2149 0 0 14 defined $_[0] and not ref $_[9]
2154 1 0 13 $mocked_dir and $mocked_dir->{'obj'}
2316 0 12 1 @mocked_files and @mocked_files != @files
2399 0 5 1 @mocked_files and @mocked_files != @files

or 2 conditions

line l !l condition
264 40 5 $_file_arg_post //= {"chmod", 1, "chown", 2, "lstat", 0, "mkdir", 0, "open", 2, "opendir", 1, "readlink", 0, "rmdir", 0, "stat", 0, "sysopen", 1, "unlink", 0, "readdir", 0}
702 0 0 $file_on_disk //= ""
1074 651 0 (_fh_to_file($file_or_fh) // _abs_path_to_file($file_or_fh)) // ""
1877 2 0 $mock_file->{'contents'} //= ""
2218 3 25 $perms // 511

or 3 conditions

line l !l&&r !l&&!r condition
376 3 8 8 ref $f_rule eq 'Regexp' || !defined($f_rule)
736 0 12 0 not defined $readlink or length $readlink
997 0 118 0 $self->{'fileno'} //= _unused_fileno()
1046 1 53 24 $file_data->is_link or defined $file_data->contents
1074 42 609 0 _fh_to_file($file_or_fh) // _abs_path_to_file($file_or_fh)
1159 0 0 0 $2 || getpwuid $<
1246 59 7 6 defined $_->{'contents'} || $_->is_link || $_->is_dir
1311 0 0 0 $^O eq 'darwin' || $^O =~ /bsd/i
1345 1 5 0 $now //= time
1829 2 2 58 $mode eq "|-" or $mode eq "-|"
4 2 56 $mode eq "|-" or $mode eq "-|" or not grep({$_ eq $mode;} ">", "<", ">>", "+<", "+>", "+>>")
4 28 28 $mode eq "|-" or $mode eq "-|" or not grep({$_ eq $mode;} ">", "<", ">>", "+<", "+>", "+>>") or not defined $mock_file
1876 2 0 23 $mode eq ">>" or $mode eq "+>>"
5 2 16 $mode eq ">" or $mode eq "+>"
1982 0 0 24 scalar @_ != 2 or not defined $_[1]
2328 12 0 0 $> == 0 || $) =~ /( ^ | \s ) 0 ( \s | $)/msx
2360 0 0 0 $> != $uid or not $is_in_group
2438 0 0 37 !$^V || $^V lt 5.18.0