Branch Coverage

blib/lib/Test/Class.pm
Criterion Covered Total %
branch 151 158 95.5


line true false branch
52 837 99 ref $self ? :
62 1 597 unless my $test_info = _test_info($self)
74 93 52 if ('Test::Class::MethodInfo'->is_num_tests($arg)) { }
51 1 elsif ('Test::Class::MethodInfo'->is_method_type($arg)) { }
90 116 6 unless $parent_class->can($name)
91 4 2 if _method_info($class, $parent_class, $name)
98 1 121 if ($symbol eq 'ANON') { }
102 1 120 if _is_public_method($class, $name)
104 1 120 unless eval { do { $class->add_testinfo($name, _parse_attribute_args($args)) } }
126 509 124 ref $self ? :
132 58 1 unless ref $proto
144 1 301 if $@
152 425 332 if ($info->type eq 'test')
156 34 56 unless &$filter($class, $name)
161 174 683 if ($info->is_type($type))
162 171 3 unless $type eq 'test' and not $name =~ /$method_regexp/
175 2 45 if (my $reason = $self->SKIP_CLASS)
176 1 1 $reason eq '1' ? :
179 23 22 unless @test_methods
184 2 20 if $num_startup_shutdown_methods eq 'no_plan'
187 2 18 if $num_fixture_tests eq 'no_plan'
189 4 14 if $num_tests eq 'no_plan'
196 47 6 if (_isa_class('Test::Class', $test)) { }
4 2 elsif (defined $test and $test =~ /^\d+$/) { }
198 8 39 if $n eq 'no_plan'
203 1 1 unless defined $test
217 31 281 unless $info
219 16 265 if $num_tests eq 'no_plan'
221 254 11 unless $num_tests =~ /^\+/
236 0 104 if ($Builder->can('history')) { }
242 5 99 if $start_test == $current_test
244 12 110 unless $result
253 2 7 if defined $Current_method and $method ne $Current_method
265 115 88 if defined $optional_value
280 8 121 unless (defined $description)
285 17 112 unless ($is_ok)
294 17 87 unless $skip_reason
298 3 101 if $num_expected eq 'no_plan'
299 97 7 if ($num_done == $num_expected) { }
1 6 elsif ($num_done > $num_expected) { }
300 5 92 if $exception
307 4 4 if ($exception) { }
312 2 2 if ($self->fail_if_returned_early) { }
328 100 10 if $Builder->has_plan
330 1 9 if ($num_tests eq 'no_plan') { }
341 3 109 if @_
347 1 138 unless defined $object_or_class
348 0 138 if $object_or_class eq 'Contextual::Return::Value'
350 126 12 if $object_or_class->isa($class)
360 1 44 unless $Check_block_has_run
363 35 9 if (@tests == 1 and not ref $tests[0])
370 3 60 if $t =~ /^\d+$/
371 1 59 unless _isa_class('Test::Class', $t)
373 3 56 if (my $reason = $t->SKIP_CLASS) { }
375 1 2 unless $reason eq '1'
377 51 5 unless ref $t
379 41 13 if (@test_methods)
381 7 1 unless _has_no_tests($t, $method)
383 1 7 unless $method_passed
384 1 7 unless $method_passed
391 3 51 if $ENV{'TEST_VERBOSE'}
394 84 6 unless _has_no_tests($t, $method)
395 11 77 unless _run_method($t, $method, \@tests)
396 8 80 if (_threw_exception($t, $method))
397 6 2 if $method eq $test
405 7 1 unless _has_no_tests($t, $method)
406 0 8 unless _run_method($t, $method, \@tests)
418 9 26 if $class eq 'Test::Class'
419 20 6 if _isa_class('Test::Class', $class)
426 1 20 unless my $class = _find_calling_test_class($self)
428 1 19 unless my $info = _method_info($self, $class, $method)
430 6 13 if defined $n
436 0 9 unless defined $Current_method
447 1 3 unless $Builder->expected_tests
453 0 3 unless $Builder->has_plan
455 0 3 $Builder->can('history') ? :
457 3 0 $num_failed < 254 ? :
462 1 1 unless $Builder->has_plan
472 1 5 unless (ref $cb eq 'CODE')