Branch Coverage

blib/lib/Term/ProgressBar.pm
Criterion Covered Total %
branch 94 140 67.1


line true false branch
313 0 0 if $self->silent
317 0 0 if ($@)
325 0 0 if $^O eq 'MSWin32' or $^O eq 'cygwin'
326 0 0 if ($@)
335 0 0 unless ($result)
468 5 20 if @_ == 2
478 0 20 if @_ != 1
485 14 6 if (UNIVERSAL::isa($_[0], 'HASH')) { }
492 0 20 if (my(@bad) = grep((!exists {ETA => undef, bar_width => undef, count => undef, fh => \undef, lbrack => '[', major_char => '=', max_update_rate => 0.5, minor_char => '*', name => undef, rbrack => ']', remove => 0, silent => 0, term => undef, term_width => undef}->{$_}), keys %config))
497 0 20 unless defined $target
505 15 5 unless defined $config{'term'}
507 16 4 if ($__FORCE_TERM) { }
0 7 elsif ($config{'term'} and not defined $config{'term_width'}) { }
511 0 16 if $config{'term_width'} < 5
514 0 0 if $config{'term_width'} < 5
517 15 5 unless (defined $config{'bar_width'})
518 12 3 if (defined $config{'term_width'}) { }
522 29 7 defined $config{$_} ? :
525 5 7 if defined $config{'name'}
527 1 11 if defined $config{'ETA'}
528 0 12 if ($config{'bar_width'} < 1)
538 0 3 if $config{'bar_width'} < 1
686 967 20 unless @_
687 0 20 if @_ != 1
688 0 20 if $_[0] < 1
693 145 20 unless @_
694 0 20 if @_ != 1
695 0 20 if $self->term and $_[0] < 5
702 21 575 if (@_)
705 19 2 if ($target)
719 0 330 if $self->silent
720 20 310 if (@_)
723 0 20 if defined $type and not exists {linear => 1}->{$type}
789 115 458 if $self->silent
793 101 357 unless (defined $so_far)
798 0 458 unless $self->scale == 1
807 24 434 if ($target < 0) { }
22 412 elsif ($target == 0) { }
808 4 20 if ($input_so_far <= 0 or $input_so_far == $self->last_update)
811 4 0 if (defined $name)
812 3 1 if (not $self->remove or $input_so_far >= 0)
815 0 4 if (not $self->remove and $input_so_far < 0)
824 22 0 if defined $name
835 3 409 if ($self->minor) { }
837 3 0 unless $so_far == $target
846 310 102 if ($self->term > 0) { }
849 44 266 if defined $name
857 11 299 if (defined $ETA and $ratio > 0)
858 11 0 if ($ETA eq 'linear') { }
859 1 10 if ($ratio == 1) { }
0 10 elsif ($ratio < 0.01) { }
864 0 1 if ($hh > 99) { }
875 10 0 if ($left < 600) { }
880 0 0 if ($left < 86400) { }
0 0 elsif ($left < 259200) { }
890 9 1 if ($left > 0)
892 9 0 if $so_far + $incr > $next
901 305 5 unless (defined $_ and $_ eq $to_print)
908 0 310 unless $self->scale == 1
911 0 10 if ($so_far >= $target and $self->remove and not $self->pb_ended)
919 102 0 if ($self->term) { }
920 1 0 if ($so_far == 0 and defined $name and not $self->name_printed)
927 50 52 if $add
933 0 102 unless $self->scale == 1
942 2 100 if ($input_so_far >= $target)
943 1 1 if ($self->pb_ended) { }
946 1 0 if ($self->term)
955 16 395 if $next > $target
986 103 106 if $self->silent
992 106 0 if ($self->term) { }