Branch Coverage

blib/lib/IO/All.pm
Criterion Covered Total %
branch 133 182 73.0


line true false branch
63 0 579 if $pkg ne $self->_package
77 514 65 if $INC{$ucfirst_class_fn}
78 5 60 if $INC{"IO/All/\U$class_id\E.pm"}
80 58 2 if (eval "require $ucfirst_class_name; 1") { }
1 1 elsif (eval "require IO::All::\U$class_id; 1\E") { }
84 58 0 $class->can('new') ? :
103 1 643 if ref $self
105 3 641 if UNIVERSAL::isa($name, 'IO::All')
106 134 507 unless defined $name
107 0 507 if UNIVERSAL::isa($name, 'GLOB') or ref \$name eq 'GLOB'
111 9 498 if -l $name
112 272 226 if -f $name
113 171 55 if -d $name
114 0 55 if $name =~ /^([a-z]{3,8}):/
115 2 53 if $name =~ /^[\w\-\.]*:\d{1,5}$/
116 2 51 if $name =~ s/^\s*\|\s*// or $name =~ s/\s*\|\s*$//
118 1 50 if $name eq '$'
119 2 48 if $name eq '-'
120 1 47 if $name eq '='
121 1 46 if $name eq '?'
131 2 3 if /^(_handle|io_handle|is_open)$/
138 0 0 if @_
202 22 41 if ($swap)
208 25 38 if ($operator =~ /\{\}$/)
214 6 32 UNIVERSAL::isa($arg2, 'IO::All') ? :
223 6 32 unless $arg2_type =~ /^(scalar|array|hash|code|ref)$/
227 38 38 if defined $$table{$_}
238 32 69 unless $ref
239 0 69 if $ref eq 'CODE'
240 0 69 if $ref eq 'ARRAY'
241 0 69 if $ref eq 'HASH'
242 0 69 unless $argument->isa('IO::All')
243 9 60 if defined $argument->pathname and not $argument->type
251 1112 557 defined $name ? :
258 0 0 if $^W
279 0 0 if $_[1]->is_file and $_[1]->is_open
285 0 0 if $_[2]->is_file and $_[2]->is_open
306 0 14 if $_[1]->is_file and $_[1]->is_open
338 62 52 if (my $partial = $self->_partial_spec_class(@_))
391 5 0 if ref $_[0]
398 2 10 if wantarray
405 412 0 unless ($] < 5.008)
406 5 407 if tied *$self
408 57 355 if $self->is_open
434 2 0 unless eval { do { Cwd::abs_path($self->pathname); 0 } }
507 5 16 unless $self->is_absolute
519 57 1 if $self->_autoclose
537 2 7 if $self->is_open
545 2 3 if $self->is_open
552 19 3 $layer ? :
559 136 3 unless (@_)
560 0 136 unless exists *$self->{'buffer'}
564 0 3 ref $_[0] ? :
565 2 1 unless defined $$buffer_ref
579 0 157 unless $self->is_open
584 157 0 if defined $io_handle
600 4 42 if $self->_backwards
605 0 42 @_ ? :
607 15 27 if $self->_chomp and defined $line
610 38 4 if defined $line
611 2 2 if $self->_autoclose
617 1 5 if $self->_backwards
622 1 4 @_ ? :
624 1 4 if ($self->_chomp)
629 5 0 if @lines
630 0 0 if $self->_autoclose
651 0 3 if $self->is_open
654 3 0 if defined $mode
655 0 3 unless defined $self->mode
656 0 3 if defined $perms
658 3 0 unless ($self->is_dir)
660 0 3 if defined $self->perms
662 3 0 if (defined $self->pathname and not $self->type) { }
0 0 elsif (defined $self->_handle and not $self->io_handle->opened) { }
677 0 22 /\n\z/ ? :
686 0 46 @_ || $self->type eq 'dir' ? :
708 6 4 unless wantarray
710 1 3 if ($self->_chomp) { }
721 0 9 if ($] < 5.008)
735 0 17 if ($] < 5.008)
738 0 17 unless $encoding
739 2 15 if $self->is_open and $encoding
754 0 22 @_ ? :
756 22 0 unless @_
767 0 4 if $self->errors
769 0 4 if $self->_confess
783 4 0 if not CORE::length $dir_name or -d $dir_name or mkdir $dir_name, $self->perms || 493 or do { require File::Path; File::Path::mkpath($dir_name, 0, $self->perms || 493) } or $self->throw("Can't make $dir_name")
792 3 7 if $self->is_open
793 6 1 unless $self->type
799 0 242 unless $self->io_handle->can('error')
800 242 0 unless $self->io_handle->error