Branch Coverage

blib/lib/Device/CurrentCost/Message.pm
Criterion Covered Total %
branch 47 48 97.9


line true false branch
17 1 17 unless exists $p{'message'}
25 1 4 if exists $self->{'device_type'}
27 2 2 $self->message =~ // ? :
33 7 12 if exists $self->{'device'}
40 16 3 if exists $self->{'device'}
48 2 13 defined $name ? :
58 99 92 if exists $self->{$field}
59 58 34 if ($self->message =~ m[<$field>(.*?)]s) { }
17 17 elsif (defined $default) { }
61 13 45 $v =~ m[<([^>]+)>(.*?)]s ? :
81 2 2 if defined $time
91 1 4 if exists $self->{'time_in_seconds'}
126 2 74 unless my $ch1 = $self->_parse_field("ch1")
133 1 55 unless $self->units
134 45 10 if ($channel)
137 3 7 if exists $self->{'total'}
147 14 1 unless defined $prefix
150 5 10 if ($self->has_readings)
156 4 11 unless defined $v
160 11 4 if ($self->has_history)
179 12 12 if exists $self->{'history'}
182 1 11 unless $self->has_history
184 10 1 if ($xml =~ //) { }
187 0 100 unless my($sensor) = $data =~ /(\d+)