Branch Coverage

blib/lib/Moose/Util/TypeConstraints.pm
Criterion Covered Total %
branch 106 112 94.6


line true false branch
67 86 55 &$tc($_[0]) ? :
82 3 66 if @_ > 1
87 62 7 if (scalar @tcs == 1 and _detect_type_constraint_union($tcs[0])) { }
94 2 66 unless scalar @type_constraint_names >= 2
98 1 133 unless find_or_parse_type_constraint($_)
105 2 63 if defined $name
116 1 133 unless defined $base_type and defined $type_parameter
119 132 1 if ($REGISTRY->has_type_constraint($base_type)) { }
133 129 3 if ($base_type_tc->can('parameterize')) { }
156 17 1731 if (my $type = $REGISTRY->get_type_constraint($class))
157 6 11 if (not $type->isa('Moose::Meta::TypeConstraint::Class') && $type->class eq $class) { }
171 0 1731 unless $options
190 11 1289 if (my $type = $REGISTRY->get_type_constraint($role))
191 6 5 if (not $type->isa('Moose::Meta::TypeConstraint::Role') && $type->role eq $role) { }
205 0 1289 unless $options
218 216 0 if (my $constraint = find_or_parse_type_constraint($type_constraint_name)) { }
0 0 elsif (defined $options_for_anon_type) { }
246 277 8159 unless find_or_parse_type_constraint($type_constraint_name)
252 5 12 unless find_or_parse_type_constraint($type_constraint_name)
260 8807 470 if ($constraint = find_type_constraint($type_constraint_name)) { }
57 413 elsif (_detect_type_constraint_union($type_constraint_name)) { }
127 286 elsif (_detect_parameterized_type_constraint($type_constraint_name)) { }
298 2192 18036 if (&blessed($type) and $type->isa('Moose::Meta::TypeConstraint')) { }
302 3222 14814 unless $REGISTRY->has_type_constraint($type)
309 1 44 unless defined $constraint->name
329 2 6371 if (@_ == 1 and not ref $_[0])
335 16 6355 ref $_[0] && !&blessed($_[0]) ? :
340 6 6365 unless (exists $p{'as'})
369 1 24 if (ref $type_name eq "ARRAY" and not @methods)
373 24 1 if (@methods == 1 and ref $methods[0] eq 'ARRAY') { }
425 7 9 if (ref $type_name eq "ARRAY")
426 2 5 unless @values == 0
433 13 1 if (@values == 1 and ref $values[0] eq 'ARRAY') { }
454 3 3 if (ref $type_name eq "ARRAY")
455 1 2 unless @constraints == 0
462 2 3 if (@constraints == 1 and ref $constraints[0] eq "ARRAY")
465 3 2 if (defined $type_name)
494 38 149 if (@cases % 2 != 0)
496 1 37 unless ref $default eq "CODE"
505 411 10 unless (&blessed($type) and $type->isa("Moose::Meta::TypeConstraint"))
513 1 419 unless ref $action eq "CODE"
519 180 239 if ($type->check($to_match))
524 2 2 unless defined $default
548 6762 22 if (defined $name)
551 26 6736 if defined $type
557 2 6740 unless ($name =~ /^[\w:\.]+$/)
562 6326 436 $check ? :
9 6753 $message ? :
6631 131 $inlined ? :
572 5 6353 &blessed($parent) ? :
6357 404 if (defined $parent and $parent = &blessed($parent) ? $parent : find_or_create_isa_type_constraint($parent)) { }
585 6739 22 if defined $name
594 1 43 unless defined $type
597 5 38 if ($type->has_coercion) { }
691 1 73 unless pos $given eq length $given
741 1 0 unless &blessed($type) and $type->isa("Moose::Meta::TypeConstraint::Parameterizable")