Branch Coverage

blib/lib/Path/Router.pm
Criterion Covered Total %
branch 49 58 84.4


line true false branch
20 0 15 exists $ENV{'PATH_ROUTER_DEBUG'} ? :
102 1 2 if (not $at) { }
2 0 elsif ($#{$routes;} < $at) { }
115 3 2 unless $path eq '' or $path =~ m[/$]
129 132 6 if ($self->inline) { }
136 8 6 unless my $match = $route->match(\@parts)
139 0 6 if @matches == 0
140 6 0 if @matches == 1
154 8 4 if (not defined $min or $vars < $min) { }
1 3 elsif ($vars == $min) { }
164 1 5 if @found > 1
175 0 162 unless defined $orig_url_map{$_}
195 0 258 unless $route->defaults
198 211 53 unless exists $match{$component}
213 77 181 unless @keys >= keys %required and @keys <= keys(%required) + keys(%optional) + keys(%match)
217 54 127 if (my(@missing) = grep({not exists $url_map{$_};} keys %required))
222 10 117 if (my(@extra) = grep({not $required{$_} || $optional{$_} || $match{$_};} keys %url_map))
229 48 69 if (my(@nomatch) = grep({$url_map{$_} ne $match{$_} if exists $url_map{$_};} keys %match))
230 164 15 if exists $url_map{$_}
237 78 61 if ($route->is_component_variable($component)) { }
245 12 5 unless $route->is_component_optional($component) and $route->defaults->{$name} and $route->defaults->{$name} eq $url_map{$name}
269 69 189 if defined $url
272 6 66 unless @possible
273 63 3 if @possible == 1
290 0 6 unless $route->defaults
293 0 0 unless exists $match{$component}
307 4 2 if (not defined $min or $extra < $min) { }
1 1 elsif ($extra == $min) { }
319 1 2 if @found > 1