Branch Coverage

lib/File/DataClass/IO.pm
Criterion Covered Total %
branch 229 272 85.6


line true false branch
136 8 1 $n == 3 ? :
1 9 $n == 2 ? :
345 10 &is_hashref($_[1]) ? :
210 355 $n == 1 ? :
2 565 &is_hashref($_[0]) ? :
3 567 &$_is_one_of_us($_[0]) ? :
21 570 $n == 0 ? :
145 21 569 if not $self->name and $handle
151 1 1 unless &blessed($self)
159 0 589 if $gd
160 19 570 $self->_atomic ? :
170 13 1 if not defined $wanted[0] or $wanted[0] eq 'io'
440 2 2 if $base
442 3 1 CORE::length $self->name ? :
450 10 59 if $self->is_dir
466 1 2 if ($self->is_open and not $self->is_reading) { }
475 1 2 if ($self->is_open and not $self->is_reading) { }
482 1911 1 CORE::length $_[0]->name || $_[0]->io_handle ? :
486 1018 1 if CORE::length $self->name
488 1 0 defined $self->io_handle ? :
494 2 1 if ($cb) { }
496 1 1 unless &$cb()
506 3 5 unless $dir_name
1 4 if -d $dir_name
510 2 2 unless (CORE::mkdir $dir_name, $perms)
518 0 3 unless -d $dir_name
526 1 6 unless CORE::length $self->name
543 1 1 if defined $_[1]
547 1 1 if defined $_[1]
555 1 1 unless CORE::length $self->name
563 1 2 if $self->$_push_layer(':raw') and $self->is_open
571 1 6 if $self->$_push_layer($layer) and $self->is_open
578 3 1 if defined $_[1]
584 2 161 if (@_)
585 1 1 ref $_[0] ? :
587 1 1 unless defined ${$buffer_ref;}
592 1 160 unless exists $self->{'buffer'}
612 1 9 &is_hashref($args[-1]) ? :
613 25 1 if defined $_
633 2 2 unless defined $uid and defined $gid
636 0 2 unless 1 == CORE::chown($uid, $gid, $self->name)
647 619 273 unless $self->is_open
649 0 273 if (&is_ntfs()) { }
662 0 4 unless $to
664 3 1 unless &blessed($to) and $to->isa('File::DataClass::IO')
667 0 4 unless File::Copy::copy($self->name, $to->pathname)
685 1 20 if $self->_atomic and -f $path
696 0 48 if $entry->filename =~ / \A $pat \z /mx
710 1 1 $n == 1 ? :
1 2 &is_hashref($args[0]) ? :
1 3 $n == 0 ? :
714 2 2 if ($args->{'block_size'}) { }
729 5 0 CORE::length $_[0]->name ? :
736 1 3 unless $encoding
737 0 3 if $self->$_push_layer(":encoding($encoding)") and $self->is_open
745 0 147 if $self->io_handle->can('error') and $self->io_handle->error
753 1035 44 CORE::length $_[0]->name && -e $_[0]->name ? :
786 33 0 if defined $_[1]
792 1 18 if $self->_backwards
798 0 18 if defined $line and $self->_chomp
802 17 1 if defined $line
803 1 0 if $self->autoclose
810 1 6 if $self->_backwards
817 5 1 if ($self->_chomp)
821 5 1 if scalar @lines
822 1 0 if $self->autoclose
830 0 13 unless defined(my $l = $self->getline)
834 2 0 wantarray ? :
846 2 672 unless CORE::length $self->name
848 1 671 unless $self->type or $self->$_init_type_from_fs
850 271 400 $self->type eq 'dir' ? :
856 3 40 unless $self->exists
857 1 37 -z $name ? :
38 2 if $self->is_file
858 0 2 $self->next ? :
865 1 2 CORE::length $_[0]->name && -x $_[0]->name ? :
869 1 41 unless CORE::length $self->name
871 1 40 unless $self->type or $self->$_init_type_from_fs
873 38 2 $self->type eq 'file' ? :
877 8 455 CORE::length $_[0]->name && -l $_[0]->name ? :
881 1 1 CORE::length $_[0]->name && -r $_[0]->name ? :
889 4 1 CORE::length $_[0]->name && -w $_[0]->name ? :
901 0 5 unless $self->is_dir
912 12 1 if $deep and $path->is_dir and $follow || !$path->is_link
914 36 8 if &$_should_include_path($filter, $path)
941 0 2 unless -d $self->name
955 0 1 unless -d $self->name
963 0 3 unless $to
965 2 1 unless &blessed($to) and $to->isa('File::DataClass::IO')
968 0 3 unless File::Copy::move($self->name, $to->pathname)
976 123 333 unless defined(my $name = $self->read_dir)
981 30 303 if defined $self->_filter
993 406 263 if $self->is_open and &first_char($mode) eq &first_char(scalar $self->mode)
996 0 4 if $self->is_open and 'r' eq &first_char($mode) and '+' eq substr($self->mode, 1, 1) || '' and $self->seek(0, 0)
1001 42 221 unless $self->type
21 241 unless $self->type
1002 6 256 if $self->is_open
1004 127 135 $self->is_dir ? :
1022 11 0 if defined $_[1]
1038 0 38 @args || $self->is_dir ? :
1047 22 436 unless $self->type
1049 0 6 if $self->is_link and $self->_no_follow and $self->close
1053 1 456 if (wantarray)
1060 123 581 unless (defined($name = $self->io_handle->read))
1071 2 2 defined $base ? :
1089 1 1 unless CORE::rmdir $self->name
1104 0 1 &is_mswin() ? :
1 4 unless $self->is_open
1110 1 0 if defined $_[1]
1116 0 144 if &is_ntfs()
1124 77 67 unless $self->_lock
1126 1 66 $self->_lock == 2 ? :
1127 38 29 $self->mode eq 'r' ? :
1129 1 66 if $async
1130 67 0 flock($self->io_handle, $mode) ? :
1141 10 2 unless wantarray
1143 0 2 unless $self->_chomp
1157 2 345 unless $self->exists or $self->is_open
1161 345 0 $self->exists ? :
1170 2 2 unless defined $search and CORE::length $search
1175 2 0 if $perms
1191 2 0 wantarray ? :
1197 0 0 &is_mswin() ? :
0 3 unless $self->is_open
1207 1 1 unless $tempdir = $self->name and -d $tempdir
1219 0 7 unless CORE::length $self->name
1221 7 0 unless -e $self->name
1232 217 69 unless $self->_lock
1234 67 2 if $handle and $handle->opened
1251 1 8 if ref $r and not ${$r;}
1262 0 15 @args ? :
1264 15 0 unless scalar @args
1275 4 5 if defined $mode
1277 1 8 unless defined $self->io_handle
1281 1 7 if $chain
1283 0 7 wantarray ? :