Branch Coverage

blib/lib/Mojolicious/Routes.pm
Criterion Covered Total %
branch 67 76 88.1


line true false branch
17 338 0 if $_[0]->conditions->{$_[1]} = $_[2]
26 2 0 if $_[0]->types->{$_[1]} = $_[2]
34 921 1104 unless my $field = $stack->[$position]
43 666 438 if (my $cb = $field->{'cb'}) { }
46 1062 7 if $last or $continue
52 962 67 @{$c->match->stack;} ? :
64 8 56 unless $path =~ m[^/]u
64 966 if (defined $path) { }
70 1 1029 if $override and $method eq "POST"
71 23 1007 if $method eq "HEAD"
74 86 944 $c->tx->is_websocket ? :
78 345 685 if (my $result = $cache->get("${method}:${path}:$ws"))
84 67 618 unless my $route = $match->endpoint
92 624 42 if $last
101 64 374 if ref $field->{'app'}
105 23 351 $field->{'controller'} ? :
106 5 369 if ($field->{'app'}) { }
0 369 elsif (defined(my $ns = $field->{'namespace'})) { }
23 346 elsif ($class) { }
110 0 0 unless $class
111 0 0 $ns ? :
122 15 24 unless defined(my $found = $self->_load($class))
123 2 22 unless $found
130 1 347 @classes ? :
138 347 86 unless ($new = $self->_class($old, $field))
143 72 14 if ($new->isa('Mojolicious')) { }
14 0 elsif (my $method = $field->{'action'}) { }
147 72 0 if (my $sub = $new->can("routes"))
149 17 55 unless $r->parent
159 12 2 if (my $sub = $new->can($method)) { }
160 10 2 if $last
161 2 5 if _action($old->app, $new, $sub, $last)
176 14 27 if $self->{'loaded'}{$app}
177 2 15 ref $e ? :
17 10 if (my $e = load_class($app))
180 2 8 unless &first(sub { $app->isa($_); } , @{$self->base_classes;})
187 635 286 if $stash->{'mojo.rendered'}
188 12 23 unless $c->render_maybe or $stash->{'mojo.routed'}