Branch Coverage

blib/lib/DateTimeX/Auto.pm
Criterion Covered Total %
branch 31 60 51.6


line true false branch
46 1 6 unless @_
47 0 6 unless $datetime_class->new("$_[0]")
64 0 0 unless $duration_class->new("$_[0]")
97 2 0 if (%x) = %{$args{'object'}{'DateTimeX::Auto::DateTime'};}
104 2 15 if (scalar @_ > 2)
112 5 10 if ($string =~ /^(\d{4})-(0[1-9]|1[0-2])-([0-2][0-9]|30|31)(Z?)$/)
115 5 0 defined $4 ? :
119 2 3 if ($z eq 'Z' and defined $dt)
125 5 0 if $dt
128 5 5 if ($string =~ /^(\d{4})-(0[1-9]|1[0-2])-([0-2][0-9]|30|31)T([0-1][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z?)$/)
131 5 0 defined $8 ? :
132 2 3 defined $7 ? :
136 2 3 if (length $nano and defined $dt)
141 2 3 if ($z eq 'Z' and defined $dt)
147 5 0 if $dt
164 0 50 unless exists $$self{'DateTimeX::Auto::DateTime'}
168 31 19 unless defined $trailer
170 24 26 if $$self{'DateTimeX::Auto::DateTime'}{'format'} eq 'D'
173 16 10 if $$self{'DateTimeX::Auto::DateTime'}{'format'} eq 'DT'
205 0 5 if (scalar @_ > 2)
213 5 0 unless $string =~ /^ ([\+\-])? # Potentially negitive... P # Period of... (?:([\d\.]*)Y)? # n Years (?:([\d\.]*)M)? # n Months (?:([\d\.]*)W)? # n Weeks (?:([\d\.]*)D)? # n Days (?: T # And a time of... (?:([\d\.]*)H)? # n Hours (?:([\d\.]*)M)? # n Minutes (?:([\d\.]*)S)? # n Seconds )? /xi
244 0 0 unless $$X{$big} =~ /\./
266 0 0 $$X{'I'} eq '-' ? :
278 0 0 $self->is_negative ? :
279 0 0 if $self->years
280 0 0 if $self->months
281 0 0 if $_days
283 0 0 if $self->hours
284 0 0 if $self->minutes
285 0 0 if $_secs