Branch Coverage

blib/lib/Unit/Duration.pm
Criterion Covered Total %
branch 54 68 79.4


line true false branch
20 0 2 if $name and not $table or $table and not $name
42 1 1 if $name and $table
49 1 7 unless $name
56 0 5 unless $name
62 0 4 unless $name
74 7 4 if ($settings->{'compress'} and not $settings->{'_as'}) { }
3 1 elsif ($settings->{'_as'}) { }
91 1 6 unless $table
93 2 4 ref $table ? :
105 0 32 if @elements > 1
107 28 4 if @elements
117 0 6 if scalar grep({not $_->{'duration'};} @$units) != 1
134 6 42 unless $unit->{'duration'}
42 6 if @_ = map({$_->{'unit'};} @{[] unless $unit->{'duration'};})
135 48 0 unless ($unit->{'amount'})
138 6 42 unless $unit->{'duration'}
140 42 6 if $amount
147 0 6 if ($@)
161 6 42 if $unit->{'long'} eq $unit->{'short'}
165 42 6 if $_->{'duration'}
174 42 6 if exists $unit->{'duration'}
178 6 0 if $name
191 0 0 $3 ? :
195 0 53 unless $duration =~ /^\s*(?:$duration_element_re)+$/
213 0 83 unless ($unit_name)
226 83 581 $unit_name eq $_->{'letter'} || $unit_name eq $_->{'short'} || $unit_name eq $_->{'long'} ? :
238 4 7 if (not defined $table) { }
7 0 elsif (exists $self->{'_tables'}{$table}) { }
239 4 0 if (exists $self->{'_tables'}{'default'}) { }
260 16 22 if exists $elements{$element->{'unit'}{'long'}}
281 3 11 $settings->{'pluralize'} && $_->{'int'} != 1 ? :
294 12 22 if ($count >= 1)
304 7 27 unless $total_seconds
315 7 3 unless $unit_type