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 241 0 if $_[0]->handlers->{$_[1]} = $_[2]
53 2181 7353 if $name =~ s/\..*$//u
61 0 344 unless my $template = $self->template_name($options)
68 23347 2442 if (my $h = $self->{'proxy'}{$name} || $self->helpers->{$name})
72 2377 65 length $name ? :
74 18647 92556 $key =~ /$re/u ? :
79 2442 0 $found ? :
94 44 966 if defined $inline
98 82 928 if defined $stash->{'data'}
101 326 602 if defined $stash->{'text'}
104 51 551 if exists $stash->{'json'}
108 191 340 unless $self->_render_template($c, \my $output, $options)
112 37 3 $output =~ /\S/u ? :
40 300 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 315 if $stash->{'mojo.string'}
127 0 774 if $c->stash->{'mojo.respond'}++
131 53 721 if ($self->compress and length $output >= $self->min_compress_size)
135 50 3 if ($gzip and not $headers->content_encoding)
152 4 207 if $controller and $action
155 3 204 unless my $route = $c->match->endpoint
161 1 465 unless my $file = $self->template_name($options)
162 190 275 unless my $handlers = $self->{'templates'}{$file}
169 1 2073 unless defined(my $template = $options->{'template'})
170 0 2073 unless my $format = $options->{'format'}
173 29 2044 unless $self->{'templates'}
177 21 2052 if (defined(my $variant = $options->{'variant'}))
180 13 8 if @$handlers and not defined $handler or grep {$_ eq $handler;} @$handlers
183 1608 465 defined $handler ? :
188 0 397 unless my $name = $self->template_name($options)
212 625 16 if ($_[0]) { }
216 13 371 if $stash->{'extends'}
217 338 33 unless my $layout = delete $stash->{'layout'}
225 1 594 unless $handler
227 0 594 unless my $renderer = $self->handlers->{$handler}
230 384 190 if defined $$output