Branch Coverage

blib/lib/Test/Regexp.pm
Criterion Covered Total %
branch 84 92 91.3


line true false branch
35 1 18 if ($key eq 'tests') { }
18 0 elsif ($key eq 'import') { }
39 0 18 unless $value
62 1 246 if length $str > 55 and not $arg{'full_text'}
70 0 103 unless (defined $val)
73 83 20 if ($pretty eq $val and not $val =~ /'/) { }
20 0 elsif (not $pretty =~ /"/) { }
91 110 34 $arg{'match'} ? :
96 24 120 if ($arg{'show_line'})
117 6 138 if ($upgrade and $upgrade == 2 || !utf8::is_utf8($subject) && $subject =~ /[\x80-\xFF]/) { }
6 132 elsif ($downgrade and $downgrade == 2 || utf8::is_utf8($subject) && $subject =~ /[\x80-\xFF]/ && !($subject =~ /[^\x00-\xFF]/)) { }
120 6 0 if (utf8::upgrade($subject_utf8))
132 6 0 if (utf8::downgrade($subject_non_utf8))
181 39 105 defined $arg{'reason'} ? :
184 36 108 defined $arg{'test'} ? :
189 1 143 $arg{'no_keep_message'} ? :
201 34 47 if (ref $capture eq 'ARRAY') { }
222 4 140 if defined $todo
232 74 82 if ($match and defined $pattern)
234 56 18 ref $pattern ? :
244 3 71 unless ($Test->ok($result, $comment))
257 7 64 unless ($Test->is_eq($&, $subject, "${__}match is complete"))
264 4 60 unless $Test->is_eq(scalar @+, 1, "${__}no numbered captures")
267 2 62 unless $Test->is_eq($named_matches, 0, "${__}no named captures")
274 52 104 if ($match and defined $keep_pattern)
276 38 14 ref $keep_pattern ? :
312 2 50 unless ($Test->ok($result, $comment))
344 6 44 unless ($Test->is_eq($amp, $subject, "${__}match is complete"))
358 35 2 $minus{$key} ? :
7 30 unless $Test->is_eq($minus{$key} ? $minus{$key}[$i] : undef, $value->[$i], "$__\$- {$key} [$i] " . mess($value->[$i], 'full_text', $full_text))
364 2 31 unless $minus{$key}
30 3 @$value == 1 ? :
4 29 unless $Test->is_num(scalar @{[] unless $minus{$key};}, scalar @$value, "$__${__}capture '${key}' has " . (@$value == 1 ? '1 match' : @$value . ' matches'))
372 2 42 unless $Test->is_num(scalar keys %minus, scalar keys %$named_captures, $__ . scalar(keys %$named_captures) . ' named capture groups')
384 8 58 unless $Test->is_eq($numbered_matches[$i], $numbered_captures->[$i], "$__\$" . ($i + 1) . ' ' . mess($numbered_captures->[$i], 'full_text', $full_text))
391 4 40 @$numbered_captures == 1 ? :
5 39 unless $Test->is_num(scalar @numbered_matches, scalar @$numbered_captures, $__ . (@$numbered_captures == 1 ? '1 numbered capture group' : @$numbered_captures . ' numbered capture groups'))
402 33 123 if (not $match and defined $pattern)
404 26 7 ref $pattern ? :
409 3 30 unless $Test->ok(!$r || $subject ne $&, $comment)
412 1 155 if (not $match and defined $keep_pattern)
414 1 0 ref $keep_pattern ? :
420 0 1 unless $Test->ok(!$r || $subject ne $&, $comment)
425 4 140 if defined $todo
478 2 17 if exists $arg{'tags'}
506 15 7 @_ % 2 ? :