Branch Coverage

blib/lib/Mojolicious/Routes/Pattern.pm
Criterion Covered Total %
branch 88 90 97.7


line true false branch
18 172 15 !$path || $path eq '/' ? :
25 712 17027 unless $self->{'regex'}
27 15040 2699 unless my(@captures) = $$pathref =~ $self->regex
29 2385 314 if $#+ == 0
32 2596 371 unless @captures
34 284 87 if defined $capture
40 34 1107 @_ > 1 ? :
45 1049 1 @_ % 2 ? :
47 101 949 if $pattern eq "/"
65 381 406 if ($op eq 'text') { }
216 190 elsif ($op eq 'slash') { }
68 194 22 unless $optional
75 154 36 if (not defined $default or $default ne $part) { }
22 14 elsif ($optional) { }
83 49 671 $endpoint && $format ? :
100 569 225 if ($op eq 'text') { }
119 106 elsif ($op eq 'slash') { }
104 26 93 $optional ? :
111 7 99 if ($value->[1]) { }
112 6 20 $type eq 'relaxed' ? :
26 73 $type ? :
115 14 92 if (my $c = $$constraints{$value->[0]})
118 27 79 exists $$defaults{$value->[0]} ? :
125 546 166 if $block
128 564 148 if $detect
137 519 45 unless $format
140 4 41 if $format eq 1
144 29 12 $has_default ? :
149 15 47 if ref $req ne "ARRAY"
168 30 0 if ++$spec
30 10369 if ($char eq $quote_start) { }
30 10339 elsif ($char eq $quote_end) { }
83 10256 elsif (not $more and $char eq $start) { }
46 10210 elsif (not $more and $char eq $relaxed || $char eq $wildcard) { }
1339 8871 elsif ($char eq '/') { }
786 8085 elsif ($spec and ++$more) { }
6883 1202 elsif ($tree[-1][0] eq 'text') { }
891 311 elsif (not $tree[-2] and $tree[-1][0] eq 'slash') { }
281 30 elsif ($tree[-2] and $tree[-2][0] eq 'text' and $tree[-1][0] eq 'slash') { }
172 78 5 unless $spec++
176 39 7 unless $spec++
177 6 40 $char eq $relaxed ? :
192 281 0 if pop @tree
198 1088 147 unless $token->[0] eq "placeholder"
199 7 140 $token->[1] =~ /^(.+)\Q$type_start\E(.+)$/u ? :