Condition Coverage

blib/lib/Test/MockFile.pm
Criterion Covered Total %
condition 133 241 55.1


and 3 conditions

line !l l&&!r l&&r condition
279 0 0 32 defined $command and defined $_file_arg_post->{$command}
282 12 0 20 $command eq "open" and ref $at_under_ref
12 18 2 $command eq "open" and ref $at_under_ref and scalar @$at_under_ref == 2
522 0 31 1 defined $filename and $filename =~ /^\*?(?:main::)?[<*&+>]*STD(?:OUT|IN|ERR)$/
529 12 0 19 $command eq "open" and $at_under_ref->[1]
0 19 0 $command eq "open" and $at_under_ref->[1] and $at_under_ref->[1] =~ /&/
557 0 5 9 defined $context->{'filename'} and $context->{'filename'} =~ /$rule->{'file_rule'}/
582 0 31 0 defined $STRICT_MODE_STATUS and not $STRICT_MODE_STATUS & 4
31 0 0 defined $STRICT_MODE_STATUS and not $STRICT_MODE_STATUS & 4 and $STRICT_MODE_STATUS != $strict_mode
594 0 21 0 defined $opt and $opt eq "plugin"
631 0 0 70 defined $file and length $file
644 47 20 0 not defined $contents and @stats
662 20 40 7 defined $contents and $files_being_mocked{$dirname}
727 0 0 12 defined $file and length $file
822 0 0 46 defined $dirname and length $dirname
877 5 1 1 ref $opts eq "HASH" and $opts->{'mode'}
940 0 0 118 scalar @_ == 1 and ref $_[0]
1015 0 2 97 defined $file_or_fh and length $file_or_fh
1023 0 0 97 defined $file and defined bless( {}, 'A::BROKEN::SYMLINK' )
0 96 1 defined $file and defined bless( {}, 'A::BROKEN::SYMLINK' ) and $file eq bless( {}, 'A::BROKEN::SYMLINK' )
1024 0 0 96 defined $file and defined bless( {}, 'A::CIRCULAR::SYMLINK' )
0 95 1 defined $file and defined bless( {}, 'A::CIRCULAR::SYMLINK' ) and $file eq bless( {}, 'A::CIRCULAR::SYMLINK' )
1026 0 0 95 defined $file and length $file
1074 600 23 2 $depth and not $mock_object
1077 261 328 34 $mock_object and $mock_object->is_link
1103 1 1 631 defined $fh and length $fh
1303 2 0 0 $] < "5.019" and $^O eq 'darwin' || $^O =~ /bsd/i
1401 0 0 0 defined $readlink and ref $readlink
1420 952 0 78 defined $self->{'readlink'} && length $self->{'readlink'} && $self->{'mode'} & 40960
1548 2 0 5 scalar @_ == 2 and defined $time
2 0 5 scalar @_ == 2 and defined $time and $time =~ /^[0-9]+$/
1567 2 0 5 @_ == 2 and defined $time
2 0 5 @_ == 2 and defined $time and $time =~ /^[0-9]+$/
1586 2 0 5 @_ == 2 and defined $time
2 0 5 @_ == 2 and defined $time and $time =~ /^[0-9]+$/
1620 0 0 0 $code_ref and ref $code_ref eq "CODE"
1748 47 12 0 defined $_[0] and not ref $_[0]
1804 59 0 0 ref $file and ref $file eq "SCALAR"
1810 59 0 0 not $abs_path and $mode ne "|-"
59 0 0 not $abs_path and $mode ne "|-" and $mode ne "-|"
1840 22 3 3 not defined $mock_file->contents and grep {$mode eq $_;} "<", "+<"
1909 1 2 0 ($sysopen_mode & 131072) == 131072 and $mock_file->is_link
1915 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'}
1921 2 0 1 $sysopen_mode & 64 and not defined $mock_file->{'contents'}
1926 2 0 1 $sysopen_mode & 512 and defined $mock_file->{'contents'}
1939 3 0 0 not defined $mock_file->{'contents'} and $rd_wr_mode == 0
1969 23 0 1 defined $_[0] and not ref $_[9]
2018 0 0 28 defined $_[0] and not ref $_[9]
2059 0 0 4 defined $_[0] and not ref $_[9]
2064 0 0 4 $mocked_dir and $mocked_dir->{'obj'}
2086 0 0 1 defined $_[0] and not ref $_[9]
2091 0 0 1 $mocked_dir and $mocked_dir->{'obj'}
2114 0 0 1 defined $_[0] and not ref $_[9]
2119 0 0 1 $mocked_dir and $mocked_dir->{'obj'}
2141 0 0 14 defined $_[0] and not ref $_[9]
2146 1 0 13 $mocked_dir and $mocked_dir->{'obj'}
2308 0 12 1 @mocked_files and @mocked_files != @files
2391 0 5 1 @mocked_files and @mocked_files != @files

or 2 conditions

line l !l condition
264 29 3 $_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}
694 0 0 $file_on_disk //= ""
1066 625 0 (_fh_to_file($file_or_fh) // _abs_path_to_file($file_or_fh)) // ""
1869 2 0 $mock_file->{'contents'} //= ""
2210 3 25 $perms // 511

or 3 conditions

line l !l&&r !l&&!r condition
376 3 6 6 ref $f_rule eq 'Regexp' || !defined($f_rule)
728 0 12 0 not defined $readlink or length $readlink
989 0 118 0 $self->{'fileno'} //= _unused_fileno()
1038 1 53 24 $file_data->is_link or defined $file_data->contents
1066 42 583 0 _fh_to_file($file_or_fh) // _abs_path_to_file($file_or_fh)
1151 0 0 0 $2 || getpwuid $<
1238 59 7 6 defined $_->{'contents'} || $_->is_link || $_->is_dir
1303 0 0 0 $^O eq 'darwin' || $^O =~ /bsd/i
1337 1 5 0 $now //= time
1821 2 2 55 $mode eq "|-" or $mode eq "-|"
4 0 55 $mode eq "|-" or $mode eq "-|" or not grep({$_ eq $mode;} ">", "<", ">>", "+<", "+>", "+>>")
2 27 28 $mode eq "|-" or $mode eq "-|" or not grep({$_ eq $mode;} ">", "<", ">>", "+<", "+>", "+>>") or not defined $mock_file
1868 2 0 23 $mode eq ">>" or $mode eq "+>>"
5 2 16 $mode eq ">" or $mode eq "+>"
1974 0 0 24 scalar @_ != 2 or not defined $_[1]
2320 12 0 0 $> == 0 || $) =~ /( ^ | \s ) 0 ( \s | $)/msx
2352 0 0 0 $> != $uid or not $is_in_group
2430 0 0 34 !$^V || $^V lt 5.18.0