Branch Coverage

blib/lib/Test/Class.pm
Criterion Covered Total %
branch 153 160 95.6


line true false branch
52 897 99 ref $self ? :
62 1 637 unless my $test_info = _test_info($self)
74 103 52 if ('Test::Class::MethodInfo'->is_num_tests($arg)) { }
51 1 elsif ('Test::Class::MethodInfo'->is_method_type($arg)) { }
90 126 6 unless $parent_class->can($name)
91 4 2 if _method_info($class, $parent_class, $name)
98 1 131 if ($symbol eq 'ANON') { }
102 1 130 if _is_public_method($class, $name)
104 1 130 unless eval { do { $class->add_testinfo($name, _parse_attribute_args($args)) } }
126 549 128 ref $self ? :
132 62 1 unless ref $proto
144 1 321 if $@
152 475 332 if ($info->type eq 'test')
156 34 56 unless &$filter($class, $name)
161 184 723 if ($info->is_type($type))
162 181 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 301 unless $info
219 24 277 if $num_tests eq 'no_plan'
221 266 11 unless $num_tests =~ /^\+/
236 0 114 if ($Builder->can('history')) { }
242 5 109 if $start_test == $current_test
244 15 125 unless $result
253 2 7 if defined $Current_method and $method ne $Current_method
265 125 98 if defined $optional_value
280 22 124 unless (defined $description)
285 20 126 unless ($is_ok)
294 17 97 unless $skip_reason
298 7 107 if $num_expected eq 'no_plan'
299 101 13 if ($num_done == $num_expected) { }
5 8 elsif ($num_done > $num_expected) { }
300 5 96 if $exception
305 2 3 if ($self->fail_if_returned_late) { }
312 4 6 if ($exception) { }
318 3 3 if ($self->fail_if_returned_early) { }
335 110 10 if $Builder->has_plan
337 1 9 if ($num_tests eq 'no_plan') { }
348 3 113 if @_
354 1 142 unless defined $object_or_class
355 0 142 if $object_or_class eq 'Contextual::Return::Value'
357 130 12 if $object_or_class->isa($class)
367 1 48 unless $Check_block_has_run
370 39 9 if (@tests == 1 and not ref $tests[0])
377 3 64 if $t =~ /^\d+$/
378 1 63 unless _isa_class('Test::Class', $t)
380 3 60 if (my $reason = $t->SKIP_CLASS) { }
382 1 2 unless $reason eq '1'
384 55 5 unless ref $t
386 45 13 if (@test_methods)
388 7 1 unless _has_no_tests($t, $method)
390 1 7 unless $method_passed
391 1 7 unless $method_passed
398 3 61 if $ENV{'TEST_VERBOSE'}
401 94 6 unless _has_no_tests($t, $method)
402 14 84 unless _run_method($t, $method, \@tests)
403 8 90 if (_threw_exception($t, $method))
404 6 2 if $method eq $test
412 7 1 unless _has_no_tests($t, $method)
413 0 8 unless _run_method($t, $method, \@tests)
425 9 26 if $class eq 'Test::Class'
426 20 6 if _isa_class('Test::Class', $class)
433 1 20 unless my $class = _find_calling_test_class($self)
435 1 19 unless my $info = _method_info($self, $class, $method)
437 6 13 if defined $n
443 0 9 unless defined $Current_method
454 1 3 unless $Builder->expected_tests
460 0 3 unless $Builder->has_plan
462 0 3 $Builder->can('history') ? :
464 3 0 $num_failed < 254 ? :
469 1 1 unless $Builder->has_plan
479 1 5 unless (ref $cb eq 'CODE')