Branch Coverage

blib/lib/BusyBird/StatusStorage/Memory.pm
Criterion Covered Total %
branch 81 98 82.6


line true false branch
22 0 3 if ($$self{'max_status_num'} <= 0)
35 45 1012 unless defined $$self{'timelines'}{$timeline}
38 0 1012 if int @ret >= 2
39 533 479 int @ret == 0 ? :
50 0 0 unless (defined $filepath)
54 0 0 unless (open $file, '>', $filepath)
73 0 0 unless (defined $filepath)
77 0 0 unless (open $file, '<', $filepath)
97 481 1318 unless defined $timestamp_str
108 1 120 unless defined $args{'timeline'}
110 1 50 if (not defined $args{'mode'} or $args{'mode'} ne 'insert' and $args{'mode'} ne 'update' and $args{'mode'} ne 'upsert')
117 1 118 if (not defined $args{'statuses'}) { }
28 90 elsif (ref $args{'statuses'} eq 'HASH') { }
90 0 elsif (ref $args{'statuses'} eq 'ARRAY') { }
128 15 904 unless defined $$s{'id'}
129 3 901 if defined $$s{'busybird'} and ref $$s{'busybird'} ne 'HASH'
130 3 898 unless _is_timestamp_format_ok($$s{'created_at'})
132 3 895 unless _is_timestamp_format_ok($acked_at)
139 11 869 if $mode eq 'insert' and $existent or $mode eq 'update' and not $existent
141 24 845 if ($mode eq 'upsert')
144 548 321 if ($is_insert) { }
152 90 4 if ($put_count > 0)
154 3 87 if (int @{$$self{'timelines'}{$timeline};} > $$self{'max_status_num'})
158 94 0 if ($args{'callback'})
166 1 57 unless defined $args{'timeline'}
167 1 56 unless exists $args{'ids'}
170 7 49 if (defined $ids)
171 2 5 if (not ref $ids) { }
5 0 elsif (ref $ids eq 'ARRAY') { }
174 1 4 if grep {not defined $_;} @$ids
179 14 41 unless ($$self{'timelines'}{$timeline})
180 14 0 if ($args{'callback'})
187 5 36 if (defined $ids) { }
190 1 7 if $tl_index < 0
195 36 0 if (defined $$self{'timelines'}{$timeline})
200 41 0 if ($args{'callback'})
208 1 537 unless defined $args{'timeline'}
209 1 536 unless defined $args{'callback'}
211 68 468 unless ($$self{'timelines'}{$timeline})
217 468 0 defined $args{'count'} ? :
222 113 180 $ack_state eq 'acked' ? :
175 293 $ack_state eq 'unacked' ? :
224 169 299 if (defined $max_id)
226 23 146 if ($tl_index < 0)
231 40 106 unless (&$ack_test($s))
238 2283 5622 if (not &$ack_test($$self{'timelines'}{$timeline}[$_])) { }
726 4896 elsif (defined $start_index and $_ < $start_index) { }
246 315 90 if $count eq 'all'
249 33 372 $count <= 0 ? :