Branch Coverage

blib/lib/Mojolicious/Renderer.pm
Criterion Covered Total %
branch 73 82 89.0


line true false branch
33 0 112 if defined $param
37 63 49 $fmt ? :
39 83 29 unless @_
43 6 16 @exts ? :
46 231 0 if $_[0]->handlers->{$_[1]} = $_[2]
53 2081 6706 if $name =~ s/\..*$//u
61 0 332 unless my $template = $self->template_name($options)
68 21897 2326 if (my $h = $self->{'proxy'}{$name} || $self->helpers->{$name})
72 2265 61 length $name ? :
74 17501 83362 $key =~ /$re/u ? :
79 2326 0 $found ? :
94 42 916 if defined $inline
98 69 889 if defined $stash->{'data'}
101 306 583 if defined $stash->{'text'}
104 51 532 if exists $stash->{'json'}
108 181 331 unless $self->_render_template($c, \my $output, $options)
112 37 3 $output =~ /\S/u ? :
40 291 if $stash->{'extends'} or $stash->{'layout'}
116 44 0 if ($self->_render_template($c, \my $tmp, $options))
117 42 2 if $output =~ /\S/u
120 25 306 if $stash->{'mojo.string'}
127 0 732 if $c->stash->{'mojo.respond'}++
131 48 684 if ($self->compress and length $output >= $self->min_compress_size)
135 45 3 if ($gzip and not $headers->content_encoding)
152 4 203 if $controller and $action
155 3 200 unless my $route = $c->match->endpoint
161 1 453 unless my $file = $self->template_name($options)
162 180 273 unless my $handlers = $self->{'templates'}{$file}
169 1 2004 unless defined(my $template = $options->{'template'})
170 0 2004 unless my $format = $options->{'format'}
173 27 1977 unless $self->{'templates'}
177 21 1983 if (defined(my $variant = $options->{'variant'}))
180 13 8 if @$handlers and not defined $handler or grep {$_ eq $handler;} @$handlers
183 1551 453 defined $handler ? :
188 0 383 unless my $name = $self->template_name($options)
212 596 16 $_[0] ? :
216 13 362 if $stash->{'extends'}
217 329 33 unless my $layout = delete $stash->{'layout'}
225 1 575 unless $handler
227 0 575 unless my $renderer = $self->handlers->{$handler}
230 375 180 if defined $$output