Branch Coverage

blib/lib/Assert/Conditional.pm
Criterion Covered Total %
branch 345 374 92.2


line true false branch
251 0 5 if ($Assert::Conditional::Assert_Never) { }
5 0 elsif ($Assert::Conditional::Assert_Always) { }
301 865 10 unless $real_proto and $real_proto =~ /^\s*&/u
303 4 6 unless defined &$his_func
304 6 0 if prototype $his_func
305 0 0 unless eval "\n no warnings qw(prototype redefine);\n package $his_pack;\n sub $export ($real_proto) { 0 }\n 1;\n "
337 0 525 unless $subname =~ /^assert_/u
345 0 525 if $debugging
347 0 525 if (defined $tagref and not ref $tagref)
353 0 1770 if $debugging
366 3 2 unless $wantarray
373 1 2 unless not $wantarray
380 2 1 unless defined $wantarray and not $wantarray
388 2 1 unless not defined $wantarray
395 1 2 unless defined $wantarray
402 4 2 unless $arg
409 2 4 if $arg
417 22 443 unless defined $value
424 2 1 if defined $scalar
432 1 1 unless defined $$sref
439 1 2 unless defined $value
448 1 3 unless $this eq $that
457 1 1 unless $this ne $that
466 12 264 unless &looks_like_number($n)
474 4 1 unless not &looks_like_number($n)
482 5 6 unless $n > 0
490 1 5 unless $n <= 0
498 3 3 unless $n < 0
506 3 84 unless $n >= 0
514 1 4 unless $n == 0
522 1 1 unless $n != 0
530 8 107 unless $int == int $int
538 1 1 unless $float != int $float
546 1 4 unless $n =~ /^ [-+] /ux
595 2 3 unless /^ (?:0x)? \p{ahex}+ \z/iux
603 5 6 unless /^ (?: 0b ) [0-1]+ \z /ux or /^ (?: 0o | 0)? [0-7]+ \z /ux or /^ (?: 0x ) [0-9a-fA-F]+ \z /ux
614 1 2 unless $n % 2 == 0
622 1 1 unless $n % 2 == 1
629 4 3 unless $n >= $low and $n <= $high
638 2 2 unless length $string == 0
647 2 69 unless length $string != 0
656 2 32 unless $string =~ /^ \p{whitespace}* \z/ux
665 1 1 unless $string =~ / \P{whitespace}/ux
680 9 9 unless $string =~ /$_single_line_rx/u
688 2 10 unless not $string =~ /$_single_line_rx/u
696 10 11 unless $string =~ / \A ( (?! \R ) \X )+ \R* \z /ux
704 2 3 unless /^ [\x00-\xFF] + \z/ux
717 3 2 unless /[^\x00-\xFF]/ux
724 1 1 unless /\P{ascii}/ux
731 1 1 unless /^ \p{ASCII} + \z/ux
738 1 1 unless /^ \p{alphabetic} + \z/ux
745 1 1 unless /^ \P{alphabetic} + \z/ux
752 1 1 unless /^ \p{alnum} + \z/ux
759 1 1 unless /^ [0-9] + \z/ux
766 3 0 $] >= 5.014 ? :
2 1 unless $] >= 5.014 ? !/\p{Changes_When_Uppercased}/u : $_ eq uc $_
775 2 0 $] >= 5.014 ? :
1 1 unless $] >= 5.014 ? !/\p{Changes_When_Lowercased}/u : $_ eq lc $_
784 1 1 unless /^ \p{XID_Start} \p{XID_Continue}* \z/ux
806 1 1 unless /^ $perl_simple_ident_rx \z/ux
814 2 3 unless /^ $perl_qualified_ident_rx \z/ux
823 1 1 unless /(?: ' | :: ) /ux
830 1 1 unless /^ (?= \p{ASCII}+ \z) (?! \d) \w+ \z/ux
848 1 1 unless $string =~ /$pattern/u
858 1 1 unless not $string =~ /$pattern/u
871 1 1 unless /^[\p{Latin}\p{Common}\p{Inherited}]+/u
880 1 1 unless /[^\x00-\x{FFFF}]/ux
888 2 2 unless /^ [\x00-\x{FFFF}] * \z/ux
901 2 1 unless &checkNFC($str) // $str eq &NFC($str)
909 2 1 unless &checkNFKC($str) // $str eq &NFKC($str)
917 2 1 unless &checkNFD($str)
924 3 1 unless &checkNFKD($str)
931 1 1 unless &NFC($this) eq &NFC($that)
938 1 5 unless &UCA1($this) eq &UCA1($that)
949 22 47 $undef_needle ? :
6 63 if $undef_needle ? !defined($straw) : "$needle" eq (defined $straw && "$straw")
953 2 4 unless defined $needle
954 37 1 defined $_ ? :
963 47 22 if (defined $needle) { }
964 3 44 unless defined $straw
965 4 40 if ("$needle" eq "$straw")
970 20 2 if defined $straw
975 6 6 unless $found
976 2 4 unless defined $needle
983 2 1 unless @_
999 0 3 unless $count > 0
1005 9 2 if (@_ == 1)
1013 1 1 unless $have == $want
1023 6 5 unless $have >= $want
1033 1 1 unless $have <= $want
1042 3 1 unless $have >= $low and $have <= $high
1049 2 4 unless (@_)
1050 1 1 unless &his_args()
1056 2 2 unless $have == $want
1065 1 1 unless $have >= $want
1074 2 2 unless $have <= $want
1082 4 1 unless $have >= $low and $have <= $high
1097 2 2 unless %$href
1153 116 53 if (&reftype($_[0]) // '') =~ /^ (?: SCALAR | REF ) \z/ux
1165 2 22 unless @keylist
1168 9 13 unless @missing
1185 31 26 unless delete $allowed{$key}
1187 7 12 unless @forbidden
1202 6 26 unless @$minkeys
1204 2 24 unless @$maxkeys
1212 18 54 unless delete $allowed{$key}
1216 12 12 unless @missing or @forbidden
1218 5 7 !@missing ? :
1223 3 9 !@forbidden ? :
1281 0 3 if ($have_version < $want_version) { }
1282 0 0 if $debugging
1284 0 3 if $debugging
1286 0 3 unless eval qq(\n sub assert_locked( \\[%\$] \@ )\n :Assert( qw[hash] )\n {\n my(\$hashref) = \@_;\n _promote_to_hashref(\$hashref);\n hash_locked(%\$hashref) || botch "hash is locked";\n }\n\n sub assert_unlocked( \\[%\$] \@ )\n :Assert( qw[hash] )\n {\n my(\$hashref) = \@_;\n _promote_to_hashref(\$hashref);\n !hash_locked(%\$hashref) || botch "hash is not locked";\n }\n\n 1;\n\n)
6 5 unless &hash_locked(\%$hashref)
5 6 unless not &hash_locked(\%$hashref)
1314 25 270 unless ref $arg
1321 16 409 unless not ref $arg
1329 39 286 unless $have_type eq $want_type
1392 1 2 unless $argc >= 1
1399 1 3 unless $argc >= 1
1401 2 1 unless &blessed($self)
1408 1 2 unless $argc >= 1
1410 1 1 unless not &blessed($class)
1418 1 2 unless $argc >= 1
1431 1 18 unless $argc >= 1
1442 0 18 unless @from
1446 2 16 unless $from[0] eq $to[0]
1449 2 16 unless $from[1] eq $to[1]
1452 2 16 unless @botches == 0
1464 1 4 unless $argc >= 1
1474 0 8 if ref $self and not &Scalar::Util::blessed($self)
1485 0 4 unless @from
1488 2 2 unless $from[0]->isa($to[0]) or $self->DOES($from[0])
1507 2 14 unless %$stash
1516 1 33 unless &blessed($arg)
1524 5 18 unless not &blessed($arg)
1530 46 46 if (&blessed($invocant)) { }
1543 1 25 unless @methods
1546 17 8 unless @cant
1561 1 12 unless @methods
1564 7 5 unless @can
1610 1 37 unless @superclasses
1613 12 25 unless not @ainta
1622 1 10 unless @superclasses
1625 5 5 unless not @isa
1665 1 5 unless @roles
1668 4 1 unless not @doesnt
1678 1 3 unless @roles
1681 2 1 unless not @does
1692 5 9 unless overload::Overloaded($object)
1694 3 6 unless not @missing
1753 2 13 unless $assertion and defined &$assertion
1773 1 16 unless $assertion and defined &$assertion
1796 2 4 unless tied $$scalarref
1804 4 4 unless not tied $$scalarref
1824 2 4 unless tied @$arrayref
1832 4 4 unless not tied @$arrayref
1852 2 4 unless tied %$hashref
1860 4 4 unless not tied %$hashref
1880 3 4 unless tied *$globref
1888 4 4 unless not tied *$globref
1897 2 2 if !!&$code() == !!$joy
1898 1 1 $joy ? :
1 1 $joy ? :
1923 2 4 unless defined &openhandle($arg)
1931 0 0 unless -f $arg
1940 0 0 unless -T $arg
1947 1 1 unless -d $arg
1952 12 0 @_ ? :
1958 6 0 @_ ? :
1971 32 3 @_ ? :
1973 2 32 unless $wstat < 65536
1980 10 1 @_ ? :
1981 3 8 unless WIFSIGNALED($wstat)
1988 3 0 @_ ? :
1989 2 1 if WIFEXITED($wstat)
2000 2 1 @_ ? :
2003 1 2 unless &_WIFCORED($wstat)
2009 3 0 @_ ? :
2011 2 1 unless &_WIFCORED($wstat)
2012 0 1 unless $cored
2022 12 2 @_ ? :
2023 9 5 if WIFEXITED($wstat)
2035 2 1 @_ ? :
2037 1 2 unless $exit == 0
2044 2 1 @_ ? :
2046 1 2 unless $exit != 0