Branch Coverage

blib/lib/MarpaX/Database/Terminfo/Interface.pm
Criterion Covered Total %
branch 187 374 50.0


line true false branch
26 0 16 if (ref $optp ne 'HASH')
34 0 16 $^O eq 'dec_osf' ? :
0 16 $^O eq 'hpux' ? :
0 16 $^O eq 'aix' ? :
43 16 0 if ($cache_stubs) { }
58 0 16 if ($file)
60 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
63 0 0 if (not open($fh, '<', $file)) { }
67 0 0 unless close $fh
68 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
72 0 0 if ($@) { }
79 0 16 if (not $db_ok and $txt)
80 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
84 0 0 if ($@) { }
90 16 0 unless ($db_ok)
92 0 16 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
95 0 16 if (not open($fh, '<', $bin)) { }
99 0 16 if ($@) { }
104 0 16 unless close $fh
107 0 16 unless ($db_ok)
118 0 16 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
122 0 16 if (not open($fh, '<', $caps)) { }
131 11408 8752 if (/^\s*#/)
135 704 8048 if (/^\s*capalias\b/) { }
96 7952 elsif (/^\s*infoalias\b/) { }
143 704 7248 if ($type eq 'bool') { }
624 6624 elsif ($type eq 'num') { }
6624 0 elsif ($type eq 'str') { }
157 0 16 unless close $fh
165 16 0 if ($cache_stubs)
166 1 15 if ($stubs_txt)
168 0 1 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
171 0 1 if (not open($fh, '<', $stubs_txt)) { }
175 0 1 unless close $fh
176 0 1 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
189 0 1 if ($@) { }
197 15 1 if (not $cached_stubs_as_txt_ok and $stubs_bin)
199 0 15 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
202 0 15 if (not open($fh, '<', $stubs_bin)) { }
206 0 15 if ($@) { }
211 0 15 unless close $fh
247 0 7817 if ($MarpaX::Database::Terminfo::Interface::log->is_warn and not defined $self->{'_terminfo_db'})
256 2675 2874 if (@_)
259 0 5549 if ($MarpaX::Database::Terminfo::Interface::log->is_warn and not defined $self->{'_terminfo_current'})
268 0 819324 if ($MarpaX::Database::Terminfo::Interface::log->is_warn and not defined $self->{'_t2other'})
277 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn and not defined $self->{'_c2other'})
286 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn and not defined $self->{'_capalias'})
295 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn and not defined $self->{'_infoalias'})
304 16 45 unless (defined $self->{'_terminfo_current'})
313 0 1 if (defined $cb)
326 0 5141 if ($MarpaX::Database::Terminfo::Interface::log->is_debug)
327 0 0 if ($from) { }
335 5141 0 if (defined $terminfo_db)
339 5141 3537341 if (grep {$_ eq $name;} @{$$terminfo{'alias'};})
340 0 5141 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
354 0 2675 unless (defined $self->_terminfo_db)
358 0 2675 unless (defined $found)
370 1051 210743 if ($feature->{'type'} == 0 and substr($feature->{'name'}, -1, 1) eq '@') { }
2466 208277 elsif ($feature->{'type'} == 2 and $feature->{'name'} eq 'use') { }
374 0 1051 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
379 0 2466 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
383 0 2466 unless (defined $insert)
388 910 106851 if (exists $cancelled{$_->{'name'}})
389 0 910 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
394 6713 100138 if (exists $featured{$_->{'name'}})
395 0 6713 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
400 0 100138 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
407 0 208277 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
425 1051 208277 if ($_->{'type'} == 0 and substr($_->{'name'}, -1, 1) eq '@')
426 0 1051 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
440 2 208275 if (substr($_->{'name'}, 0, 1) eq '.')
441 0 2 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
467 208275 0 if (not exists $found->{'terminfo'}{$key}) { }
470 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
477 4592 203683 unless (exists $self->_t2other->{$key})
478 0 4592 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
487 0 203683 if ($feature->{'type'} != $type)
488 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
497 0 203683 if (not defined $termcap) { }
498 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
502 0 203683 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
505 203683 0 if (not exists $found->{'termcap'}{$termcap}) { }
508 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
517 0 203683 if (not defined $variable) { }
518 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
522 0 203683 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
525 203683 0 if (not exists $found->{'variable'}{$variable}) { }
529 180968 22715 if ($type == 2)
530 15 180953 if ($variable eq 'pad_char') { }
2452 178501 elsif ($variable eq 'cursor_up') { }
20 178481 elsif ($variable eq 'backspace_if_not_bs') { }
532 0 15 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
537 0 2452 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
542 0 20 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
548 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
559 15 2660 if (defined $pad_char)
560 0 15 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
568 2452 223 if (defined $cursor_up)
569 0 2452 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
577 20 2655 if (defined $backspace_if_not_bs)
578 0 20 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
588 0 2675 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
596 0 2675 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
606 0 2675 if (exists $found->{'terminfo'}{'ospeed'})
607 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
612 0 2675 if (exists $found->{'terminfo'}{'baudrate'})
613 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
639 185265 0 if ($self->{'_cache_stubs'})
640 176711 8554 if (exists $self->{'_cached_stubs'}{$featurevalue})
641 0 176711 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
647 8554 176711 unless (exists $self->{'_stubs'}{$featurevalue})
649 8554 0 if ($self->{'_cache_stubs_as_txt'})
650 8552 2 if (exists $self->{'_cached_stubs_as_txt'}{$featurevalue})
651 0 8552 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
657 2 8552 unless (defined $stub_as_txt)
667 0 2 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
691 0 2 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
694 2 0 if ($self->{'_cache_stubs_as_txt'})
698 0 8554 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
702 0 8554 if ($@)
706 8554 0 if ($self->{'_cache_stubs'})
721 185259 28366 if ($feature->{'type'} == 2)
771 0 2675 if (defined $fh)
773 0 0 if ($reffh ne 'GLOB')
774 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
781 2 2673 if (defined $ENV{'MARPAX_DATABASE_TERMINFO_OSPEED'}) { }
784 2673 0 if ($HAVE_POSIX)
786 0 2673 if (not defined $termios) { }
787 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
791 0 2673 defined $fh ? :
792 0 2673 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
796 0 2673 if ($@)
797 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
803 2673 0 if (defined $termios)
805 0 2673 if (not defined $this) { }
806 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
811 0 2673 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
821 0 2675 unless (exists $OSPEED_TO_BAUDRATE{$ospeed})
822 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
828 2673 2 unless ($ospeed)
830 0 2673 if ($MarpaX::Database::Terminfo::Interface::log->is_warn)
837 0 2675 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
853 45 0 if ($self->_terminfo_init)
857 15 30 if (not exists $self->_terminfo_current->{$space}{$id}) { }
861 0 15 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
871 0 30 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
874 0 30 if (defined $default_if_cancelled and exists $self->_terminfo_current->{'cancelled'}{$feature->{'name'}}) { }
875 0 0 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
883 27 3 if ($feature->{'type'} == $type) { }
3 0 elsif (defined $default_if_wrong_type) { }
885 20 7 if ($type == 2) { }
886 7 13 defined $default_if_found ? :
888 3 4 defined $default_if_found ? :
891 0 3 if ($MarpaX::Database::Terminfo::Interface::log->is_trace)
900 12 15 if (defined $found and defined $areap and ref $areap)
901 10 2 if ($type == 2) { }
902 3 7 unless (defined ${$areap;})
924 2 0 if (defined $outc)
926 1 1 if ($self->tvgetflag('no_pad_char') or not $self->tvgetstr('PC', \$PC)) { }
1034 3 0 if (not defined $self->{'_term'}) { }
1047 0 0 $str eq $bell || $str eq $flash_screen ? :
1048 0 0 !$xon_xoff && $padding_baud_rate && $baudrate >= $padding_baud_rate ? :
1053 0 3 if ($self->{'_bsd_tputs'} and length $str > 0)
1054 0 0 if ($str =~ /^([[:digit:]]+)(?:\.([[:digit:]])?[[:digit:]]*)?(\*)?/)
1055 0 0 defined $-[2] ? :
0 0 defined $-[3] ? :
1061 0 0 if ($three)
1071 51 2 if ($c ne '$') { }
1075 2 0 $index <= $indexmax ? :
1076 0 2 if ($c ne '<') { }
1078 0 0 if ($c)
1082 2 0 ++$index <= $indexmax ? :
1083 0 2 if (not $c =~ /[[:digit:]]/ and $c ne '.' or index($str, '>', $index) < $index)
1095 2 0 $index <= $indexmax ? :
1098 5 0 ++$index <= $indexmax ? :
1101 2 0 $index <= $indexmax ? :
1102 0 2 if ($c eq '.')
1103 0 0 $index <= $indexmax ? :
1104 0 0 if ($c =~ /[[:digit:]]/)
1113 2 0 $index <= $indexmax ? :
1115 0 0 if ($c eq '*') { }
1122 0 0 $index <= $indexmax ? :
1125 2 0 if ($number > 0 and $always_delay || $normal_delay || $mandatory)
1134 0 0 if ($trailpad > 0 and $always_delay || $normal_delay)
1176 0 0 if (@_)
1181 0 0 unless (defined $self->{'_use_env'})
1187 0 0 unless ($self->{'_use_env'})