Branch Coverage

blib/lib/Class/XSConstructor.pm
Criterion Covered Total %
branch 157 216 72.6


line true false branch
14 25 0 if (eval { do { require Types::Standard; 1 } }) { }
39 1 36 if ("ARRAY" eq ref $_[0])
52 0 37 if (our $REDEFINE) { }
67 9 63 if ($name eq "!!")
72 0 63 if (is_ArrayRef($thing)) { }
23 40 elsif (is_HashRef($thing)) { }
1 39 elsif (is_Object($thing) and $thing->can('compiled_check') || $thing->can('check')) { }
1 38 elsif (is_CodeRef($thing)) { }
0 38 elsif (defined $thing) { }
88 12 51 if ($name =~ /\A(.*)\!\z/)
93 1 62 if (is_Object($spec{'isa'}) and $spec{'isa'}->can('compiled_check')) { }
0 124 elsif (is_Object($spec{'isa'}) and $spec{'isa'}->can('check')) { }
104 0 1 if (defined $spec{'coerce'} and not ref $spec{'coerce'} and $spec{'coerce'} eq 1)
106 0 0 if ($type->can('has_coercion') and $type->has_coercion and $type->can('coercion') and is_Object($c = $type->coercion) and $c->can('compiled_coercion')) { }
0 0 elsif ($type->can('coerce')) { }
119 0 13 if ($spec{'required'} and exists $spec{'init_arg'} and not defined $spec{'init_arg'})
124 0 63 if (@unknown_keys)
133 5 58 exists $spec{'init_arg'} ? :
136 7 56 if (is_CodeRef($spec{'isa'}))
140 1 62 if (is_CodeRef($spec{'trigger'})) { }
2 120 elsif (defined $spec{'trigger'} and not ref $spec{'trigger'}) { }
147 1 62 if (is_CodeRef($spec{'coerce'}))
151 8 55 if (exists $spec{'default'} or defined $spec{'builder'})
153 8 0 unless $spec{'lazy'}
156 1 62 if (is_Object($type) and $type->isa("Type::Tiny"))
160 0 63 if (is_ArrayRef($spec{'alias'})) { }
1 62 elsif ($spec{'alias'}) { }
167 1 62 if (is_CodeRef($spec{'slot_initializer'}))
171 1 62 if (exists $spec{'undef_tolerant'})
175 2 61 if ($spec{'clone_on_write'} or $spec{'clone'})
183 34 3 if (my $p = $META{$package}{'params'}) { }
188 9 25 if ($META{$package}{'strict_params'})
196 20 1 if defined $_->{'init_arg'}
197 1 20 if ref $_->{'aliases'}
211 1 9 if (defined $spec->{'builder'}) { }
3 6 elsif (is_CodeRef($spec->{'default'})) { }
2 4 elsif (is_ScalarRef($spec->{'default'})) { }
228 0 19 unless defined $value
229 10 9 if ref $value
230 9 0 unless &Scalar::Util::isdual($value)
231 0 0 if $value and "$value" eq 1 and $value + 0 == 1
232 0 0 if not $value and "$value" eq "" and $value + 0 == 0
238 0 21 if utf8::is_utf8($value)
239 0 21 unless defined $value
240 10 11 if ref $value
244 8 3 if $flags & 12288 and not $flags & 16384
250 3 5 if defined $value and not ref $value and not &_is_bool($value)
259 4 0 if (is_Object($type) and $type->isa("Type::Tiny"))
261 0 4 if ($type == Types::Common::Any() or $type == Types::Common::Item()) { }
0 4 elsif ($type == Types::Common::Defined()) { }
0 4 elsif ($type == Types::Common::Ref()) { }
0 4 elsif ($type == Types::Common::Bool()) { }
3 1 elsif ($type == Types::Common::Int()) { }
0 1 elsif ($type == Types::Common::PositiveOrZeroInt()) { }
0 1 elsif ($type == Types::Common::Num()) { }
0 1 elsif ($type == Types::Common::PositiveOrZeroNum()) { }
0 1 elsif ($type == Types::Common::Str()) { }
0 1 elsif ($type == Types::Common::NonEmptyStr()) { }
0 1 elsif ($type == Types::Common::ClassName()) { }
0 1 elsif ($type == Types::Common::Object()) { }
0 1 elsif ($type == Types::Common::ScalarRef()) { }
0 1 elsif ($type == Types::Common::CodeRef()) { }
0 1 elsif ($type == Types::Common::ArrayRef()) { }
1 0 elsif ($type == Types::Common::HashRef()) { }
0 0 elsif ($type->is_parameterized and @{$type->parameters;} == 1 and $type->parameterized_from == Types::Common::ArrayRef() || $type->parameterized_from == Types::Common::HashRef()) { }
313 0 0 unless $no_recurse
331 13 50 if $spec->{'required'}
332 7 56 if is_CodeRef($spec->{'isa'})
333 1 62 if is_CodeRef($spec->{'coerce'})
334 3 60 if exists $spec->{'init_arg'} and not defined $spec->{'init_arg'}
335 2 61 if defined $spec->{'init_arg'} and $spec->{'init_arg'} ne $name
336 3 60 if $spec->{'trigger'}
337 1 62 if $spec->{'weak_ref'}
338 1 62 if $spec->{'alias'}
339 1 62 if $spec->{'slot_initializer'}
340 1 62 if $spec->{'undef_tolerant'}
341 2 61 if $spec->{'clone_on_write'} or $spec->{'clone'}
343 63 0 unless ($spec->{'lazy'})
346 8 55 if exists $spec->{'default'} or defined $spec->{'builder'}
348 7 56 if exists $spec->{'default'}
351 1 62 if ($type) { }
6 56 elsif (is_CodeRef($spec->{'isa'})) { }
363 0 9 unless @_ == 1
366 0 9 unless defined $default
367 0 9 if &_created_as_number($default) and $default == 0
368 1 8 if &_created_as_number($default) and $default == 1
369 0 8 if &_is_bool($default) and not $default
370 0 8 if &_is_bool($default) and $default
371 0 8 if &_created_as_string($default) and $default eq ""
372 1 7 if is_ScalarRef($default) and $$default eq "[]"
373 1 6 if is_ScalarRef($default) and $$default eq "{}"
381 37 0 $] >= 5.01 ? :
385 28 9 unless @isa
392 1 0 if ($INC{'Moo.pm'} and $Moo::MAKERS{$parent})
396 9 0 if (defined &{"${parent}::new";})
397 3 6 unless ($META{$parent})
409 4 6 unless my $p_attrs = $META{$parent}{'params'}
420 0 2 unless ($klass->can("DEMOLISH"))
425 2 0 $] >= 5.01 ? :
431 3 0 *{$_;}{'CODE'} ? :
443 27 8 unless ($klass->can("BUILD"))
448 8 0 $] >= 5.01 ? :
453 13 1 *{$_;}{'CODE'} ? :
463 0 34 unless my $meta = $META{$klass}
466 34 0 unless $meta->{'has_standard_buildargs'}
469 2 32 if $meta->{'foreignconstructor'} and not $meta->{'foreignbuildall'}
477 27 6 unless $BUILD_CACHE{$klass}
483 0 1 unless $DEMOLISH_CACHE{$klass}