Branch Coverage

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


line true false branch
21 0 3 if ($$self{'max_status_num'} <= 0)
34 45 1012 unless defined $$self{'timelines'}{$timeline}
37 0 1012 if int @ret >= 2
38 533 479 int @ret == 0 ? :
49 0 0 unless (defined $filepath)
53 0 0 unless (open $file, '>', $filepath)
72 0 0 unless (defined $filepath)
76 0 0 unless (open $file, '<', $filepath)
96 481 1318 unless defined $timestamp_str
107 1 120 unless defined $args{'timeline'}
109 1 50 if (not defined $args{'mode'} or $args{'mode'} ne 'insert' and $args{'mode'} ne 'update' and $args{'mode'} ne 'upsert')
116 1 118 if (not defined $args{'statuses'}) { }
28 90 elsif (ref $args{'statuses'} eq 'HASH') { }
90 0 elsif (ref $args{'statuses'} eq 'ARRAY') { }
127 15 904 unless defined $$s{'id'}
128 3 901 if defined $$s{'busybird'} and ref $$s{'busybird'} ne 'HASH'
129 3 898 unless _is_timestamp_format_ok($$s{'created_at'})
131 3 895 unless _is_timestamp_format_ok($acked_at)
138 11 869 if $mode eq 'insert' and $existent or $mode eq 'update' and not $existent
140 24 845 if ($mode eq 'upsert')
143 548 321 if ($is_insert) { }
151 90 4 if ($put_count > 0)
153 3 87 if (int @{$$self{'timelines'}{$timeline};} > $$self{'max_status_num'})
157 94 0 if ($args{'callback'})
165 1 57 unless defined $args{'timeline'}
166 1 56 unless exists $args{'ids'}
169 7 49 if (defined $ids)
170 2 5 if (not ref $ids) { }
5 0 elsif (ref $ids eq 'ARRAY') { }
173 1 4 if grep {not defined $_;} @$ids
178 14 41 unless ($$self{'timelines'}{$timeline})
179 14 0 if ($args{'callback'})
186 5 36 if (defined $ids) { }
189 1 7 if $tl_index < 0
194 36 0 if (defined $$self{'timelines'}{$timeline})
199 41 0 if ($args{'callback'})
207 1 537 unless defined $args{'timeline'}
208 1 536 unless defined $args{'callback'}
210 68 468 unless ($$self{'timelines'}{$timeline})
216 468 0 defined $args{'count'} ? :
221 113 180 $ack_state eq 'acked' ? :
175 293 $ack_state eq 'unacked' ? :
223 169 299 if (defined $max_id)
225 23 146 if ($tl_index < 0)
230 40 106 unless (&$ack_test($s))
237 2283 5622 if (not &$ack_test($$self{'timelines'}{$timeline}[$_])) { }
726 4896 elsif (defined $start_index and $_ < $start_index) { }
245 315 90 if $count eq 'all'
248 33 372 $count <= 0 ? :