Branch Coverage

lib/Test/Assert.pm
Criterion Covered Total %
branch 213 240 88.7


line true false branch
110 2 6 if ($caller eq 'main')
134 1 2 if ($caller eq 'main')
151 120 3 __isa($_[0], 'Test::Assert') ? :
167 2 6 __isa($_[0], 'Test::Assert') ? :
170 2 6 unless defined $boolean
171 2 4 unless $boolean
179 2 6 __isa($_[0], 'Test::Assert') ? :
182 3 5 if $boolean
190 2 6 __isa($_[0], 'Test::Assert') ? :
193 5 3 if defined $value
201 2 7 __isa($_[0], 'Test::Assert') ? :
204 2 7 unless defined $value
212 2 38 __isa($_[0], 'Test::Assert') ? :
215 3 1 unless defined $value1 or defined $value2
216 1 36 unless defined $value1
219 2 34 unless defined $value2
220 15 19 if ($value1 =~ /^[+-]?(\d+\.\d+|\d+\.|\.\d+|\d+)([eE][+-]?\d+)?$/ and $value2 =~ /^[+-]?(\d+\.\d+|\d+\.|\.\d+|\d+)([eE][+-]?\d+)?$/) { }
224 6 9 unless $value1 == $value2
227 7 12 unless $value1 eq $value2
236 2 29 __isa($_[0], 'Test::Assert') ? :
239 2 2 unless (defined $value1 or defined $value2)
242 4 25 if not defined $value1 xor not defined $value2
243 16 9 if ($value1 =~ /^[+-]?(\d+\.\d+|\d+\.|\.\d+|\d+)([eE][+-]?\d+)?$/ and $value2 =~ /^[+-]?(\d+\.\d+|\d+\.|\.\d+|\d+)([eE][+-]?\d+)?$/) { }
247 9 7 unless $value1 != $value2
250 2 7 unless $value1 ne $value2
259 2 18 __isa($_[0], 'Test::Assert') ? :
262 3 2 unless defined $value1 or defined $value2
264 2 15 unless defined $value1
265 1 14 unless defined $value2
266 1 13 unless $value1 == $value2
274 2 16 __isa($_[0], 'Test::Assert') ? :
277 1 1 unless (defined $value1 or defined $value2)
280 2 15 if not defined $value1 xor not defined $value2
282 12 3 unless $value1 != $value2
290 2 11 __isa($_[0], 'Test::Assert') ? :
293 3 1 unless defined $value1 or defined $value2
294 1 9 unless defined $value1
297 1 8 unless defined $value2
298 4 4 unless "$value1" eq "$value2"
306 2 11 __isa($_[0], 'Test::Assert') ? :
309 1 3 unless (defined $value1 or defined $value2)
312 4 8 if not defined $value1 xor not defined $value2
313 4 4 unless "$value1" ne "$value2"
321 2 7 __isa($_[0], 'Test::Assert') ? :
324 1 8 unless defined $regexp
327 1 7 unless ref $regexp eq 'Regexp'
330 1 6 unless defined $value
331 1 5 unless $value =~ /$regexp/
339 2 6 __isa($_[0], 'Test::Assert') ? :
342 2 6 unless defined $regexp
345 3 3 unless defined $value
346 1 2 unless ref $regexp eq 'Regexp'
349 1 1 if $value =~ /$regexp/
357 2 35 __isa($_[0], 'Test::Assert') ? :
360 5 32 unless ref $value1 or ref $value2
361 1 31 unless ref $value1
362 1 30 unless ref $value2
367 15 15 unless $self->_deep_check($value1, $value2, $data_stack, $seen_refs)
378 2 13 __isa($_[0], 'Test::Assert') ? :
381 3 12 unless ref $value1 or ref $value2
382 1 11 unless ref $value1
383 1 10 unless ref $value2
388 4 6 if $self->_deep_check($value1, $value2, $data_stack, $seen_refs)
399 2 9 __isa($_[0], 'Test::Assert') ? :
403 1 10 unless defined $class
406 1 9 unless defined $value
407 2 7 unless (__isa($value, $class))
408 1 1 if ref $value
418 1 6 __isa($_[0], 'Test::Assert') ? :
422 1 6 unless defined $class
425 2 4 if (__isa($value, $class))
435 2 187 __isa($_[0], 'Test::Assert') ? :
442 187 2 if ($@) { }
444 127 60 if (ref $e and __isa($e, 'Exception::Base')) { }
445 126 1 if $e->matches($expected)
448 53 7 if (ref $expected eq 'Regexp') { }
3 4 elsif (ref $expected eq 'ARRAY') { }
4 0 elsif (not ref $expected) { }
449 52 1 if "$e" =~ /$expected/
452 2 1 if grep {__isa($e, $_);} @{$expected;}
458 2 2 if $caught_message eq $expected
477 0 0 __isa($_[0], 'Test::Assert') ? :
487 0 0 if defined $_[1]
490 0 0 if defined $_[2]
495 0 0 unless ($ok_return)
496 0 0 defined $message ? :
0 0 defined $message && $message ne '' && $ok_message ne '' ? :
0 0 $ok_message =~ /\n/s ? :
0 0 $ok_message ne '' && $diag_message ne '' ? :
0 0 $diag_message =~ /\n/s ? :
503 0 0 unless $ok_return
515 7 186 unless (defined $e1 and defined $e2)
516 3 1 unless defined $e1 or defined $e2
521 99 87 if $e1 eq $e2
523 73 14 if (ref $e1 and ref $e2)
525 4 69 if defined $$seen_refs{$e1} and $$seen_refs{$e1} eq $e2_ref
529 34 49 if (ref $e1 eq 'ARRAY' and ref $e2 eq 'ARRAY') { }
29 20 elsif (ref $e1 eq 'HASH' and ref $e2 eq 'HASH') { }
0 20 elsif (ref $e1 eq 'REF' and ref $e2 eq 'REF') { }
3 17 elsif (ref $e1 eq 'SCALAR' and ref $e2 eq 'SCALAR') { }
538 0 0 if $ok
557 0 34 if $a1 eq $a2
560 1 33 $#$a1 > $#$a2 ? :
563 1 103 $_ > $#$a1 ? :
564 1 103 $_ > $#$a2 ? :
568 92 12 if $ok
570 12 92 unless $ok
581 0 29 if $a1 eq $a2
584 1 28 keys %$a1 > keys %$a2 ? :
586 46 0 exists $$a1{$k} ? :
587 45 1 exists $$a2{$k} ? :
591 28 18 if $ok
593 18 28 unless $ok
609 9 27 if ($type eq 'HASH') { }
10 17 elsif ($type eq 'ARRAY') { }
2 15 elsif ($type eq 'REF') { }
610 6 3 unless $did_arrow++
614 7 3 unless $did_arrow++
631 3 23 $val eq $DNE ? :
4 26 !defined($val) ? :