Branch Coverage

blib/lib/Test/Weaken.pm
Criterion Covered Total %
branch 139 176 78.9


line true false branch
71 5 85 if (defined $user_tracked_types)
76 90 0 unless defined $trace_maxdepth
96 48 636 if $already_followed{&Scalar::Util::refaddr($follow_probe)}++
102 0 636 if ($trace_following)
105 0 0 unless print {*STDERR;} 'Following: ', 'Data::Dumper'->new([$follow_probe], ['tracking'])->Terse(1)->Maxdepth($trace_maxdepth)->Dump
112 50 586 if (defined $contents)
121 22 208 if &$ignore($safe_copy)
124 83 529 if ($object_type eq 'ARRAY')
125 1 82 if (my $tied_var = tied @{$follow_probe;})
129 144 5 if (exists $$follow_probe[$i])
136 79 450 if ($object_type eq 'HASH')
137 1 78 if (my $tied_var = tied %{$follow_probe;})
146 7 443 if ($object_type eq 'GLOB')
147 1 6 if (my $tied_var = tied *${$follow_probe;})
155 0 299 if ($object_type eq 'SCALAR' or $object_type eq 'VSTRING' or $object_type eq 'LVALUE')
159 1 143 if (my $tied_var = tied ${$follow_probe;})
165 297 2 if ($object_type eq 'REF')
166 0 297 if (my $tied_var = tied ${$follow_probe;})
181 2 573 unless $tracked_type{$child_type}
186 48 525 if $already_tracked{&Scalar::Util::refaddr($new_tracking_probe)}++
191 22 154 if &$ignore($safe_copy)
194 0 501 if ($trace_tracking)
196 0 0 unless print {*STDERR;} 'Tracking: ', 'Data::Dumper'->new([$new_tracking_probe], ['tracking'])->Terse(1)->Maxdepth($trace_maxdepth)->Dump
229 36 54 if (ref $arg1 eq 'CODE')
231 7 29 if (defined $arg2)
237 0 54 if (ref $arg1 ne 'HASH')
241 54 0 if (defined(my $constructor = delete $$arg1{'constructor'}))
245 6 48 if (defined(my $destructor = delete $$arg1{'destructor'}))
248 2 52 if (defined(my $destructor_method = delete $$arg1{'destructor_method'}))
252 25 29 if (defined(my $coderef = delete $$arg1{'ignore'}))
253 0 25 if (ref $coderef ne 'CODE')
258 3 51 if (defined(my $ignore_preds = delete $$arg1{'ignore_preds'}))
261 3 51 if (defined(my $ignore_class = delete $$arg1{'ignore_class'}))
264 2 52 if (defined(my $ignore_classes = delete $$arg1{'ignore_classes'}))
268 3 51 if (defined(my $ignore_objects = delete $$arg1{'ignore_objects'}))
272 0 54 if (defined $$arg1{'trace_maxdepth'})
277 0 54 if (defined $$arg1{'trace_following'})
282 0 54 if (defined $$arg1{'trace_tracking'})
287 6 48 if (defined $$arg1{'contents'})
292 0 54 if (defined $$arg1{'test'})
297 5 49 if (defined $$arg1{'tracked_types'})
304 0 54 if (@unknown_named_args)
315 54 0 if (my $ref_type = ref $$self{'constructor'})
316 0 54 unless ref $$self{'constructor'} eq 'CODE'
320 6 48 if (my $ref_type = ref $$self{'destructor'})
321 0 6 unless ref $$self{'destructor'} eq 'CODE'
325 6 48 if (my $ref_type = ref $$self{'contents'})
326 0 6 unless ref $$self{'contents'} eq 'CODE'
330 5 49 if (my $ref_type = ref $$self{'tracked_types'})
331 0 5 unless ref $$self{'tracked_types'} eq 'ARRAY'
335 4 50 if (@ignore_classes)
338 20 10 if (&Scalar::Util::blessed($ref))
340 12 16 if ($ref->isa($class))
351 4 50 if (@ignore_objects)
356 12 32 if (&Scalar::Util::refaddr($object) == $ref)
372 0 90 if (defined $$self{'unfreed_probes'})
384 0 112 unless (ref ${$test_object_probe;})
394 293 312 if ref $_ eq 'REF'
398 0 86 unless ($test)
408 2 84 if (defined(my $destructor_method = $$self{'destructor_method'}))
414 13 73 if (defined $destructor)
436 2 10 if (ref $probe eq 'REF' and &Scalar::Util::isweak(${$probe;})) { }
456 2 0 if wantarray
464 43 31 if $result
471 0 25 unless (defined $result)
480 0 25 unless (defined $result)
489 0 5 unless (defined $count)
499 0 10 unless (defined $count)
509 0 10 unless (defined $count)
520 2 16 unless defined $max_errors
521 0 18 unless (&Scalar::Util::looks_like_number($max_errors))
524 1 17 if $max_errors <= 0
526 8 10 unless defined $reporting_depth
527 0 18 unless (&Scalar::Util::looks_like_number($reporting_depth))
531 8 10 if $reporting_depth < 0
533 8 10 unless defined $compare_depth
534 0 18 if (not &Scalar::Util::looks_like_number($compare_depth) or $compare_depth < 0)
554 150 89 if ($reporting_depth >= 0)
568 0 239 if ($array_context) { }
582 150 89 if ($reporting_depth >= 0)
598 1 238 if ($before_weak != $after_weak)
599 1 0 $before_weak ? :
603 27 212 if ($before_dump ne $after_dump)
609 28 211 if ($problems)
614 8 20 if $include_before
616 8 20 if $include_after
620 4 24 if ($max_errors > 0 and $error_count >= $max_errors)
630 0 235 $array_context ? :