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 233 0 if $_[0]->handlers->{$_[1]} = $_[2]
53 2101 7087 if $name =~ s/\..*$//u
61 0 342 unless my $template = $self->template_name($options)
68 22341 2350 if (my $h = $self->{'proxy'}{$name} || $self->helpers->{$name})
72 2288 62 length $name ? :
74 17898 89021 $key =~ /$re/u ? :
79 2350 0 $found ? :
94 42 931 if defined $inline
98 69 904 if defined $stash->{'data'}
101 307 597 if defined $stash->{'text'}
104 51 546 if exists $stash->{'json'}
108 189 337 unless $self->_render_template($c, \my $output, $options)
112 37 3 $output =~ /\S/u ? :
40 297 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 312 if $stash->{'mojo.string'}
127 0 739 if $c->stash->{'mojo.respond'}++
131 52 687 if ($self->compress and length $output >= $self->min_compress_size)
135 49 3 if ($gzip and not $headers->content_encoding)
152 4 205 if $controller and $action
155 3 202 unless my $route = $c->match->endpoint
161 1 463 unless my $file = $self->template_name($options)
162 188 275 unless my $handlers = $self->{'templates'}{$file}
169 1 2060 unless defined(my $template = $options->{'template'})
170 0 2060 unless my $format = $options->{'format'}
173 28 2032 unless $self->{'templates'}
177 21 2039 if (defined(my $variant = $options->{'variant'}))
180 13 8 if @$handlers and not defined $handler or grep {$_ eq $handler;} @$handlers
183 1597 463 defined $handler ? :
188 0 394 unless my $name = $self->template_name($options)
212 603 16 $_[0] ? :
216 13 368 if $stash->{'extends'}
217 335 33 unless my $layout = delete $stash->{'layout'}
225 1 589 unless $handler
227 0 589 unless my $renderer = $self->handlers->{$handler}
230 381 188 if defined $$output