Branch Coverage

blib/lib/Mojo/Exception.pm
Criterion Covered Total %
branch 46 50 92.0


line true false branch
18 2 13 unless $err
20 2 11 if ref $spec ne "ARRAY" or @$spec % 2
28 4 16 if $checks eq "default"
30 3 13 ref $checks eq 'ARRAY' ? :
32 5 8 if $is_obj and not $is_re and $err->isa($c)
33 3 10 if $is_re and $str =~ /$c/u
38 1 10 unless $handler ||= $default
47 15 118 if @{$self->line;}
55 86 32 if (my $zero = $self->frames->[0])
59 56 85 unless -r $file->[0] and open my $handle, "<", $file->[0]
65 24 9 if @sources
70 171 15 defined $_[1] ? :
73 4 1 @_ > 1 ? :
75 0 1 unless eval "package $class; use Mojo::Base 'Mojo::Exception'; 1"
1 4 if (not $class->can('new')) { }
1 3 elsif (not $class->isa(__PACKAGE__)) { }
87 50 228 unless ($str =~ /\n$/u)
88 10 40 @$frames ? :
90 211 67 unless $self->verbose
93 66 1 if (@$line)
100 67 0 if (my $max = @$frames)
128 0 109 unless defined $sources->[0][$num - 1]
134 40 411 if (my $previous = $num - $i) < 0
141 0 545 if (my $next = $num + $i) < 0
142 147 398 unless defined $sources->[0][$next]