Branch Coverage

blib/lib/Perinci/Result/Format/Lite.pm
Criterion Covered Total %
branch 114 208 54.8


line true false branch
26 30 71 if &$f()
33 1 0 if (eval {
0 0 elsif (eval {
0 0 elsif (eval {
44 0 1 if ($@) { }
50 2 0 if ($cleanser) { }
64 12 0 if ($header_row) { }
76 0 12 if ($ENV{'FORMAT_PRETTY_TABLE_COLUMN_ORDERS'}) { }
0 12 elsif (my $rfos = $resmeta->{'cmdline.format_options'} // $resmeta->{'format_options'}) { }
81 0 0 if ($rfo)
85 0 12 if ($tcos)
90 0 0 unless &first(sub {
97 1 11 if ($resmeta->{'table.field_orders'})
107 11 1 if ($column_orders)
133 2 10 unless my $tff = $resmeta->{'table.fields'}
141 0 12 unless $header_row and @$data
142 2 10 unless my $tff = $resmeta->{'table.fields'}
147 10 30 unless $field_idx >= 0
148 2 28 if ($tfl and defined $tfl->[$field_idx]) { }
3 50 elsif ($tfu and defined $tfu->[$field_idx]) { }
162 9 0 unless $tffmt or $tffmt_code or $tffmt_default
167 4 8 $tffmt_code ? :
168 9 3 if $field_idx >= 0
170 6 6 if (ref $fmt eq 'ARRAY') { }
182 3 3 if $i == 0 and $header_row
185 0 12 unless defined $row->[$j]
188 2 10 unless $fmt_name
190 4 6 if ($fmt_name eq 'iso8601_datetime' or $fmt_name eq 'iso8601_date' or $fmt_name eq 'datetime' or $fmt_name eq 'date') { }
0 6 elsif ($fmt_name eq 'boolstr') { }
0 6 elsif ($fmt_name eq 'filesize') { }
0 6 elsif ($fmt_name eq 'sci2dec') { }
0 6 elsif ($fmt_name eq 'percent') { }
6 0 elsif ($fmt_name eq 'number') { }
191 4 0 if ($row->[$j] =~ /\A[0-9]+(\.[0-9]*)?\z/)
192 0 4 $1 ? :
194 1 3 if ($fmt_name eq 'iso8601_datetime' or $fmt_name eq 'datetime') { }
195 0 1 $frac ? :
205 0 0 $row->[$j] ? :
210 0 0 if ($row->[$j] =~ /\A(?:[+-]?)(?:\d+\.|\d*\.(\d+))[eE]([+-]?\d+)\z/)
211 0 0 if $n < 0
231 12 0 if ($format eq 'text-pretty') { }
0 0 elsif ($format eq 'csv') { }
0 0 elsif ($format eq 'tsv') { }
0 0 elsif ($format eq 'ltsv') { }
0 0 elsif ($format eq 'html') { }
243 9 0 unless $tfa or $tfa_code or $tfa_default
244 0 3 unless @$data
248 3 9 $tfa_code ? :
249 8 4 if $field_idx >= 0
251 1 11 unless $align
256 3 8 if ($align eq "number")
260 15 0 if (@$row > $colidx) { }
262 3 12 if ($header_row and $i == 0) { }
8 4 elsif ($cell =~ /\A([+-]?\d+)(\.?)(\d*)[%]?\z/) { }
4 0 elsif ($cell =~ /\A([+-]?\d+\.?\d*)([eE])([+-]?\d+)\z/) { }
292 3 0 if ($header_row)
294 1 2 if ($maxw_d == 0 and $maxw_ad == 0)
301 55 0 @$_ > $colidx ? :
309 0 275 unless @$row > $colidx
311 0 275 unless defined $cell
312 75 200 if ($align eq 'number') { }
75 125 elsif ($align eq 'right') { }
50 75 elsif ($align eq 'middle' or $align eq 'center') { }
314 15 60 if ($header_row and $i == 0) { }
8 52 elsif (($bd, $d, $ad) = $cell =~ /\A([+-]?\d+)(\.?)(\d*)\z/) { }
4 48 elsif (($bd, $d, $ad) = $cell =~ /\A([+-]?\d+\.?\d*)([eE])([+-]?\d+)\z/) { }
331 4 71 if $maxw > $w
352 0 12 if $ENV{'INSIDE_EMACS'}
353 0 12 if ($backend) { }
365 0 12 unless $fres =~ /\R\z/ or not length $fres
397 0 0 $resmeta->{'table.html_class'} ? :
400 0 0 $i == 0 ? :
401 0 0 if $i == 0
402 0 0 if $i == 1
408 0 0 if ($field_idx >= 0 and $tfa->[$field_idx])
410 0 0 if $align eq "number"
411 0 0 if $align eq "center"
413 0 0 $align ? :
419 0 0 if $i == 0
426 0 0 if $header_row
434 16 2 if ($format =~ /\A(text|text-simple|text-pretty|csv|tsv|ltsv|html)\z/)
435 0 0 -t STDOUT ? :
0 16 $format eq 'text' ? :
438 1 15 if (not $res->[0] =~ /^(2|304)/) { }
0 15 elsif ($res->[3] and $res->[3]{'x.hint.result_binary'}) { }
440 0 1 if (my $prev = $res->[3]{'prev'})
450 3 12 if (not ref $data) { }
0 12 elsif (ref $data eq 'ARRAY' and not @$data) { }
0 12 elsif (Data::Check::Structure::is_aos($data, {'max', $max})) { }
0 12 elsif (Data::Check::Structure::is_aoaos($data, {'max', $max})) { }
1 11 elsif (Data::Check::Structure::is_hos($data, {'max', $max})) { }
11 0 elsif (Data::Check::Structure::is_aohos($data, {'max', $max})) { }
452 1 2 unless not length $data or $data =~ /\n\z/
461 0 0 if ($res->[3]{'table.fields'})
473 1 10 if ($res->[3] and $res->[3]{'table.fields'} and $res->[3]{'table.hide_unknown_fields'}) { }
496 0 2 if $is_naked
498 0 2 if ($format eq "perl")
500 0 0 if ($use_color and eval {
0 0 elsif (eval {
518 1 1 unless ($format =~ /\Ajson(-pretty)?\z/)
522 2 0 if $cleanse // 1
523 2 0 if ($format =~ /json/)
524 0 0 if ($tff and _json()->can("sort_by") and eval {
530 0 2 if ($format eq 'json') { }