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 23327 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 42 964 if defined $inline
98 82 924 if defined $stash->{'data'}
101 324 600 if defined $stash->{'text'}
104 51 549 if exists $stash->{'json'}
108 191 338 unless $self->_render_template($c, \my $output, $options)
112 37 3 $output =~ /\S/u ? :
40 298 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 313 if $stash->{'mojo.string'}
127 0 770 if $c->stash->{'mojo.respond'}++
131 53 717 if ($self->compress and length $output >= $self->min_compress_size)
135 50 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 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 621 16 if ($_[0]) { }
216 13 369 if $stash->{'extends'}
217 336 33 unless my $layout = delete $stash->{'layout'}
225 1 592 unless $handler
227 0 592 unless my $renderer = $self->handlers->{$handler}
230 382 190 if defined $$output