Branch Coverage

lib/Ruby/Collections/Array.pm
Criterion Covered Total %
branch 358 574 62.3


line true false branch
32 0 3 unless ref $self eq 'Ruby::Collections::Array'
47 0 2 unless ref $self eq 'Ruby::Collections::Array'
64 0 3 unless ref $self eq 'Ruby::Collections::Array'
67 2 1 if (looks_like_number $sep_or_n) { }
68 1 1 if $sep_or_n < 0
86 0 1 unless ref $self eq 'Ruby::Collections::Array'
90 2 3 if (not $new_ary->include($item) and $self->include($item) and ra($other)->include($item))
108 0 4 unless ref $self eq 'Ruby::Collections::Array'
111 4 1 if (defined $block) { }
112 1 3 unless &$block($item)
115 1 0 unless defined $item
129 0 12 unless ref $self eq 'Ruby::Collections::Array'
132 11 7 if (defined $block) { }
133 1 10 if &$block($item)
136 6 1 if defined $item
149 0 2 unless ref $self eq 'Ruby::Collections::Array'
152 1 6 if (reftype $item eq 'ARRAY')
154 1 0 if (p_obj($sub_array[0]) eq p_obj($target))
172 0 305 unless ref $self eq 'Ruby::Collections::Array'
185 0 2 unless ref $self eq 'Ruby::Collections::Array'
188 1 7 if (&$block($item))
206 0 1 unless ref $self eq 'Ruby::Collections::Array'
213 2 4 if (p_obj($key) eq p_obj($prev)) { }
217 3 1 if ($i != 0)
227 1 0 if ($chunk->has_any)
242 0 78 unless ref $self eq 'Ruby::Collections::Array'
261 0 3 unless ref $self eq 'Ruby::Collections::Array'
266 0 3 if ($n < 0)
267 0 0 if (defined $block) { }
274 0 3 if ($n == 0)
275 0 0 if (defined $block) { }
288 1 7 if (defined $block) { }
296 1 2 if (defined $block) { }
312 0 1 unless ref $self eq 'Ruby::Collections::Array'
316 3 2 if (defined $item)
332 0 1 unless ref $self eq 'Ruby::Collections::Array'
336 3 2 if (defined $item)
353 0 12 unless ref $self eq 'Ruby::Collections::Array'
370 0 3 unless ref $self eq 'Ruby::Collections::Array'
372 2 1 if (defined $obj_or_block)
373 1 1 if (ref $obj_or_block eq 'CODE') { }
376 3 0 if (&$obj_or_block($item))
385 2 1 if (p_obj($obj_or_block) eq p_obj($item))
407 0 1 unless ref $self eq 'Ruby::Collections::Array'
409 0 1 if (defined $n_or_block and not $block_or_n) { }
410 0 0 if (ref $n_or_block eq 'CODE')
435 0 18 unless ref $self eq 'Ruby::Collections::Array'
440 3 15 if ($before_len == scalar @{$self;}) { }
441 0 3 if (defined $block)
459 0 20 unless ref $self eq 'Ruby::Collections::Array'
463 0 20 if (scalar @{$self;} == 0) { }
20 0 elsif ($index >= 0 and $index < scalar @{$self;}) { }
0 0 elsif ($index <= -1 and $index >= -scalar(@{$self;})) { }
487 0 1 unless ref $self eq 'Ruby::Collections::Array'
502 0 1 unless ref $self eq 'Ruby::Collections::Array'
504 0 1 if ($n < 0)
510 2 3 if ($i >= $n)
527 0 1 unless ref $self eq 'Ruby::Collections::Array'
532 6 1 if (not &$block($item) or $cut_point)
550 0 2 unless ref $self eq 'Ruby::Collections::Array'
567 0 3 unless ref $self eq 'Ruby::Collections::Array'
569 1 2 if $n <= 0
573 5 2 if ($i + $n <= scalar @{$self;})
578 2 3 if (defined $block) { }
587 1 1 if (defined $block) { }
604 0 1 unless ref $self eq 'Ruby::Collections::Array'
606 0 1 if (defined $block)
623 0 4 unless ref $self eq 'Ruby::Collections::Array'
640 0 3 unless ref $self eq 'Ruby::Collections::Array'
642 1 2 if not defined $n or $n <= 0
649 0 2 scalar(@{$self;}) % $n == 0 ? :
652 10 2 $j < scalar @{$self;} ? :
660 0 4 if (defined $block) { }
668 0 2 if (defined $block) { }
684 0 1 unless ref $self eq 'Ruby::Collections::Array'
686 1 0 if (defined $block)
704 0 1 unless ref $self eq 'Ruby::Collections::Array'
706 1 0 if (defined $block)
723 0 1 unless ref $self eq 'Ruby::Collections::Array'
725 0 1 if (scalar @{$self;} == 0) { }
741 0 6 unless ref $self eq 'Ruby::Collections::Array'
743 0 6 if (reftype $other ne 'ARRAY')
747 0 6 if (scalar @{$self;} != scalar @{$other;})
752 4 5 if (p_obj(@{$self;}[$i]) ne p_obj(@{$other;}[$i]))
768 0 3 unless ref $self eq 'Ruby::Collections::Array'
770 3 0 $self->eql($other) == 0 ? :
787 0 4 unless ref $self eq 'Ruby::Collections::Array'
789 2 2 if ($index >= scalar @{$self;} or $index < -scalar(@{$self;}))
790 1 1 if (defined $default_value_or_block) { }
791 0 1 if (ref $default_value_or_block eq 'CODE') { }
824 2 4 if (@_ == 2) { }
2 2 elsif (@_ == 3) { }
2 0 elsif (@_ == 4) { }
825 1 1 if (ref $_[1] eq 'CODE') { }
827 0 1 unless ref $self eq 'Ruby::Collections::Array'
837 0 1 unless ref $self eq 'Ruby::Collections::Array'
847 1 1 if (ref $_[2] eq 'CODE') { }
849 0 1 unless ref $self eq 'Ruby::Collections::Array'
859 0 1 unless ref $self eq 'Ruby::Collections::Array'
869 1 1 if (ref $_[3] eq 'CODE') { }
871 0 1 unless ref $self eq 'Ruby::Collections::Array'
880 0 1 unless ref $self eq 'Ruby::Collections::Array'
899 0 1 unless ref $self eq 'Ruby::Collections::Array'
902 1 1 if (&$block($item))
922 0 2 unless ref $self eq 'Ruby::Collections::Array'
924 1 1 if (ref $obj_or_block eq 'CODE') { }
926 1 1 if &$obj_or_block(@{$self;}[$i])
932 1 1 if p_obj(@{$self;}[$i]) eq p_obj($obj_or_block)
947 0 283 unless ref $self eq 'Ruby::Collections::Array'
949 0 283 if (ref $obj_or_block eq 'CODE') { }
951 0 0 if (&$obj_or_block(@{$self;}[$i]))
958 277 246 if (p_obj(@{$self;}[$i]) eq p_obj($obj_or_block))
975 0 3 unless ref $self eq 'Ruby::Collections::Array'
977 2 1 if (@_ == 1) { }
1 0 elsif (@_ == 2) { }
1014 0 142 unless ref $self eq 'Ruby::Collections::Array'
1016 1 141 if (defined $n) { }
1017 0 1 if $n < 0
1038 0 1 unless ref $self eq 'Ruby::Collections::Array'
1043 2 0 if (reftype($_[0]) eq 'ARRAY') { }
1044 0 2 if ($_[0]->has_any(sub { reftype($_[0]) eq 'ARRAY'; } )) { }
1070 0 1 unless ref $self eq 'Ruby::Collections::Array'
1074 0 2 if (defined $n and $n > 0 and reftype $item eq 'ARRAY') { }
2 0 elsif (not defined $n and reftype $item eq 'ARRAY') { }
1093 0 9 unless &CORE::GLOBAL::caller() eq 'Ruby::Collections::Array'
1098 0 14 if (defined $n and $n > 0 and reftype $item eq 'ARRAY') { }
0 14 elsif (not defined $n and reftype $item eq 'ARRAY') { }
1120 0 4 unless ref $self eq 'Ruby::Collections::Array'
1124 5 5 if (defined $n and $n > 0 and reftype $item eq 'ARRAY') { }
2 3 elsif (not defined $n and reftype $item eq 'ARRAY') { }
1149 0 4 unless ref $self eq 'Ruby::Collections::Array'
1153 8 4 if (p_obj($item) =~ /$pattern/)
1154 4 4 if (defined $block) { }
1174 0 1 unless ref $self eq 'Ruby::Collections::Array'
1179 1 3 if ($$new_hash{$key}) { }
1199 0 29 unless ref $self eq 'Ruby::Collections::Array'
1202 15 50 if (p_obj($item) eq p_obj($obj))
1220 0 1 unless ref $self eq 'Ruby::Collections::Array'
1222 1 0 if (reftype $other_ary eq 'ARRAY') { }
1245 0 3 if ($index < -scalar(@{$self;})) { }
1 2 elsif ($index > scalar @{$self;}) { }
1258 1 1 $index < 0 ? :
1272 0 272 unless ref $self eq 'Ruby::Collections::Array'
1283 0 271 unless ref $self eq 'Ruby::Collections::Array'
1296 0 3153 unless ref $self eq 'Ruby::Collections::Array'
1298 3153 0 if (defined $separator) { }
1314 0 1 unless ref $self eq 'Ruby::Collections::Array'
1330 0 14 unless ref $self eq 'Ruby::Collections::Array'
1332 1 13 if (defined $n) { }
1358 0 3 unless ref $self eq 'Ruby::Collections::Array'
1372 0 5 unless ref $self eq 'Ruby::Collections::Array'
1391 0 10 unless ref $self eq 'Ruby::Collections::Array'
1414 0 4 unless ref $self eq 'Ruby::Collections::Array'
1416 2 2 if (defined $block) { }
1432 0 2 unless ref $self eq 'Ruby::Collections::Array'
1447 0 4 unless ref $self eq 'Ruby::Collections::Array'
1449 2 2 if (defined $block) { }
1465 0 2 unless ref $self eq 'Ruby::Collections::Array'
1479 0 4 unless ref $self eq 'Ruby::Collections::Array'
1481 2 2 if (defined $block) { }
1505 0 2 unless ref $self eq 'Ruby::Collections::Array'
1524 0 2 unless ref $self eq 'Ruby::Collections::Array'
1526 1 1 if (defined $block) { }
1528 1 1 if &$block($item)
1533 0 0 if $item
1550 0 2 unless ref $self eq 'Ruby::Collections::Array'
1553 1 1 if (defined $block) { }
1555 1 2 if (&$block($item))
1557 0 1 if $count > 1
1563 1 0 if ($item)
1565 0 1 if $count > 1
1570 2 0 $count == 1 ? :
1583 0 1 unless ref $self eq 'Ruby::Collections::Array'
1590 3 4 if (&$block($item)) { }
1612 0 1 unless ref $self eq 'Ruby::Collections::Array'
1618 0 1 if ($n < 0)
1619 0 0 if (defined $block) { }
1626 1 0 if ($n == undef)
1629 0 1 if ($n == 0)
1630 0 0 if (defined $block) { }
1647 0 2 if (defined $block) { }
1656 0 1 if (defined $block) { }
1674 0 6 unless ref $self eq 'Ruby::Collections::Array'
1676 1 5 if (defined $n) { }
1677 0 1 if $n < 0
1699 0 1 unless ref $self eq 'Ruby::Collections::Array'
1702 0 1 if (ref $_[-1] eq 'CODE')
1717 0 4 if (defined $block) { }
1725 0 1 if (defined $block) { }
1741 0 3709 unless ref $self eq 'Ruby::Collections::Array'
1754 0 16 unless ref $self eq 'Ruby::Collections::Array'
1769 0 1 unless ref $self eq 'Ruby::Collections::Array'
1772 1 0 if (reftype $item eq 'ARRAY')
1774 1 0 if (p_obj($sub_array[-1]) eq p_obj($target))
1794 0 1 unless ref $self eq 'Ruby::Collections::Array'
1810 0 1 unless ref $self eq 'Ruby::Collections::Array'
1815 0 1 if (scalar @{$self;} == $before_len) { }
1831 0 1 unless ref $self eq 'Ruby::Collections::Array'
1834 0 1 if ($n < 0)
1835 0 0 if (defined $block) { }
1842 0 1 if ($n == 0)
1843 0 0 if (defined $block) { }
1861 0 6 if (defined $block) { }
1870 0 1 if (defined $block) { }
1880 0 1 unless &CORE::GLOBAL::caller() eq 'Ruby::Collections::Array'
1899 0 5 unless &CORE::GLOBAL::caller() eq 'Ruby::Collections::Array'
1904 3 2 if ($$loop_counter[$i] < $end) { }
2 0 elsif ($i != 0 and $$loop_counter[$i - 1] != $end) { }
1928 0 1 unless ref $self eq 'Ruby::Collections::Array'
1931 0 1 if ($n < 0)
1932 0 0 if (defined $block) { }
1939 0 1 if ($n == 0)
1940 0 0 if (defined $block) { }
1958 0 4 if (defined $block) { }
1967 0 1 if (defined $block) { }
1976 0 1 unless &CORE::GLOBAL::caller() eq 'Ruby::Collections::Array'
1992 0 3 unless &CORE::GLOBAL::caller() eq 'Ruby::Collections::Array'
1997 2 1 if ($$loop_counter[$i] < $end) { }
1 0 elsif ($i != 0 and $$loop_counter[$i - 1] != $end) { }
2021 0 2 unless ref $self eq 'Ruby::Collections::Array'
2037 0 2 unless ref $self eq 'Ruby::Collections::Array'
2053 0 1 unless ref $self eq 'Ruby::Collections::Array'
2056 1 0 if (defined $block)
2075 0 2 unless ref $self eq 'Ruby::Collections::Array'
2077 1 1 if (ref $obj_or_block eq 'CODE') { }
2079 1 1 if (&$obj_or_block(@{$self;}[$i]))
2086 1 1 if (p_obj(@{$self;}[$i]) eq p_obj($obj_or_block))
2106 0 3 unless ref $self eq 'Ruby::Collections::Array'
2108 1 2 unless defined $count
2112 3 0 if (scalar @{$self;} > 0)
2114 3 2 if ($count > 0) { }
2 0 elsif ($count < 0) { }
2134 0 3 unless ref $self eq 'Ruby::Collections::Array'
2136 1 2 unless defined $count
2138 3 0 if (scalar @{$self;} > 0)
2140 3 2 if ($count > 0) { }
2 0 elsif ($count < 0) { }
2163 0 2 unless ref $self eq 'Ruby::Collections::Array'
2165 1 1 if (defined $n) { }
2166 0 1 if $n < 0
2197 0 1 unless ref $self eq 'Ruby::Collections::Array'
2216 0 1 unless ref $self eq 'Ruby::Collections::Array'
2221 0 1 if (scalar @{$self;} == $before_len) { }
2239 0 8 unless ref $self eq 'Ruby::Collections::Array'
2241 1 7 if (defined $n) { }
2242 0 1 if $n < 0
2263 0 5 unless ref $self eq 'Ruby::Collections::Array'
2278 0 1 unless ref $self eq 'Ruby::Collections::Array'
2304 0 1 unless ref $self eq 'Ruby::Collections::Array'
2334 0 2 unless ref $self eq 'Ruby::Collections::Array'
2336 1 1 if (defined $length) { }
2337 0 1 if ($index < -scalar(@{$self;}) or $index >= scalar @{$self;})
2359 0 2 unless ref $self eq 'Ruby::Collections::Array'
2361 1 1 if (defined $length) { }
2362 0 1 if ($index < -scalar(@{$self;}) or $index >= scalar @{$self;})
2365 0 1 if $index < 0
2389 0 2 unless ref $self eq 'Ruby::Collections::Array'
2393 1 1 if (ref @_[0] eq 'CODE') { }
2397 1 5 if (not defined $group) { }
2 3 elsif (&$block($item)) { }
2415 1 5 if (not defined $group) { }
2 3 elsif (p_obj($item) =~ /$pattern/) { }
2429 2 0 if (defined $group and $group->has_any)
2445 0 30 unless ref $self eq 'Ruby::Collections::Array'
2448 7 23 if (defined $block) { }
2453 32 31 if (looks_like_number(p_obj($a)) and looks_like_number(p_obj($b))) { }
2476 0 2 unless ref $self eq 'Ruby::Collections::Array'
2478 1 1 if (defined $block) { }
2483 11 0 if (looks_like_number(p_obj($a)) and looks_like_number(p_obj($b))) { }
2505 0 7 unless ref $self eq 'Ruby::Collections::Array'
2512 25 0 if (looks_like_number(p_obj(@{$a;}[0])) and looks_like_number(p_obj(@{$b;}[0]))) { }
2534 0 1 unless ref $self eq 'Ruby::Collections::Array'
2541 7 0 if (looks_like_number(p_obj(@{$a;}[0])) and looks_like_number(p_obj(@{$b;}[0]))) { }
2564 0 1 unless ref $self eq 'Ruby::Collections::Array'
2566 1 0 if (defined $n) { }
2567 0 1 if $n < 0
2588 0 1 unless ref $self eq 'Ruby::Collections::Array'
2592 3 1 if (&$block($item)) { }
2611 0 2 unless ref $self eq 'Ruby::Collections::Array'
2628 0 0 unless ref $self eq 'Ruby::Collections::Array'
2648 0 5 unless ref $self eq 'Ruby::Collections::Array'
2650 0 5 if ref $_[-1] eq 'CODE'
2658 0 13 if (defined $block) { }
2666 0 5 if (defined $block) { }
2682 0 1 unless ref $self eq 'Ruby::Collections::Array'
2686 3 0 unless ($union->include($item))
2691 2 1 unless ($union->include($item))