Branch Coverage

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


line true false branch
22 0 15 exists $ENV{'PATH_ROUTER_DEBUG'} ? :
104 1 2 if (not $at) { }
2 0 elsif ($#{$routes;} < $at) { }
117 3 2 unless $path eq '' or $path =~ m[/$]
131 133 6 if ($self->inline) { }
138 8 6 unless my $match = $route->match(\@parts)
141 0 6 if @matches == 0
142 6 0 if @matches == 1
156 8 4 if (not defined $min or $vars < $min) { }
1 3 elsif ($vars == $min) { }
166 1 5 if @found > 1
177 0 163 unless defined $orig_url_map{$_}
197 0 260 unless $route->defaults
200 211 53 unless exists $match{$component}
215 77 183 unless @keys >= keys %required and @keys <= keys(%required) + keys(%optional) + keys(%match)
219 54 129 if (my(@missing) = grep({not exists $url_map{$_};} keys %required))
224 10 119 if (my(@extra) = grep({not $required{$_} || $optional{$_} || $match{$_};} keys %url_map))
231 166 15 if exists $url_map{$_}
49 70 if (my(@nomatch) = grep({$url_map{$_} ne $match{$_} if exists $url_map{$_};} keys %match))
239 78 62 if ($route->is_component_variable($component)) { }
243 12 5 unless $route->is_component_optional($component) and $route->defaults->{$name} and $route->defaults->{$name} eq $url_map{$name}
271 70 190 if defined $url
274 6 67 unless @possible
275 64 3 if @possible == 1
292 0 6 unless $route->defaults
295 0 0 unless exists $match{$component}
309 4 2 if (not defined $min or $extra < $min) { }
1 1 elsif ($extra == $min) { }
321 1 2 if @found > 1