Branch Coverage

blib/lib/Pinwheel/Controller.pm
Criterion Covered Total %
branch 173 174 99.4


line true false branch
88 1 0 if exists $$hooks{'initialise'}
103 9 12 unless $$request{'time'}
115 1 20 if (exists $$hooks{'before_dispatch'})
125 8 9 unless $$ctx{'headers'}
126 1 15 if ($$hooks{'after_dispatch'})
133 5 16 if $@
146 5 23 unless _check_route_params($route)
147 5 23 unless $route
152 1 22 unless $controller
154 1 21 unless $fn
163 22 4 scalar @_ & 1 ? :
170 18 8 unless defined $only_path
172 1 25 unless $path
174 12 13 if ($$ctx{'request'} and not $path =~ m[^\w+://])
176 7 5 unless $only_path
187 5 4 if scalar @_ > 1
191 5 4 if (defined $url and $url =~ m[/]) { }
192 2 3 unless $url =~ m[^\w+://]
210 1 53 if $$ctx{'headers'}
213 1 52 if (not $$ctx{'rendering'} and $options{'format'})
221 48 2 if ($$ctx{'rendering'} == 0)
222 31 17 if ref $content
245 1 1 if $status == 500
257 10 12 if $status == 500
261 21 1 if (($$ctx{'error'} || 0) < 2)
266 3 19 if (not $template) { }
278 2 17 if $@
281 10 12 if $status == 500
352 2 6 unless $format
355 5 6 if ($format eq $_)
371 1 5 unless $format
378 5 11 ref $_[0] eq 'CODE' ? :
382 1 5 if (not exists $handlers{$format}) { }
386 1 4 if (defined $fn) { }
400 1 4 if scalar @_ == 1
409 7 3 unless ($q = $$ctx{'query'})
411 1 6 unless defined $t
412 1 11 $_ eq '' ? :
417 6 4 if scalar @_ == 1
430 9 2 if $value
455 5 8 unless $path =~ m[^/]
458 3 10 if ($$ctx{'request'})
463 5 8 if $path =~ m[/\.]
490 32 35 if $$opts{'status'}
491 29 38 unless $$h{'status'}
493 59 8 if $format
494 9 58 unless $type
495 17 50 if $$h{'content-type'}
496 2 65 if $$opts{'content_type'}
499 10 57 if $$opts{'location'}
510 19 47 if (exists $$options{'text'}) { }
519 1 46 unless $name
521 42 4 unless $format
523 44 2 unless $srcformat
525 2 44 unless $template
543 25 27 unless $locals
546 13 39 unless $helpers
554 34 16 if ($layout)
568 27 9 if (m[^\Q$templates_root\E/(.+)\.($types)$])
571 25 2 if -f $_
583 118 68 if exists $template_cache{$name}
584 9 59 unless $name =~ m[^\w+/\w+\.\w+$]
587 89 44 unless -f ($filename = "$templates_root/$name.$ext")
609 7 46 if ($$options{'partial'}) { }
610 1 6 if $$options{'partial'} =~ m[^(\w+)/]
611 6 1 unless $base
617 10 43 if (defined $$options{'layout'}) { }
1 42 elsif ($$options{'partial'}) { }
1 41 elsif (defined $$ctx{'controller'}{'layout'}) { }
627 33 20 if (not defined $name) { }
10 10 elsif ($name) { }
629 26 7 if $controller
630 32 1 unless $layout
634 1 9 unless $layout
647 25 6 if $info = $controllers{$name}
651 2 4 unless $$pkg{'ACTIONS'}
654 1 3 if $layout
666 1 35 unless ($layout_helpers)
679 24 20 unless $name =~ /::/
681 2 42 unless $exports = $$pkg{'EXPORT_OK'}
683 1 61 unless $$pkg{$_}
697 1 6 unless $$pkg{$_}
722 8 59 if ($$options{'action'}) { }
32 27 elsif ($$options{'template'}) { }
11 16 elsif ($$options{'partial'}) { }
728 6 5 unless $name =~ m[/]
734 13 54 unless $name =~ m[^(\w+/\w+)$]