Condition Coverage

blib/lib/Type/Nano.pm
Criterion Covered Total %
condition 7 62 11.2


and 2 conditions

line l !l condition
168 0 0 $_->check($val) and return 1

and 3 conditions

line !l l&&!r l&&r condition
90 0 0 0 not ref $_ and {1, 1, 0, 1, '', 1}->{$_}

or 2 conditions

line l !l condition
145 0 0 $obj->can($_) or return !1
178 0 0 $_->check($val) or return !1
209 10 0 $self->{'constraint'} ||= sub { 1; }

or 3 conditions

line l !l&&r !l&&!r condition
27 0 2 0 $TYPES{'Any'} ||= 'Type::Nano'->new('name', 'Any', 'constraint', sub { ; } )
35 0 2 0 $TYPES{'Defined'} ||= 'Type::Nano'->new('name', 'Defined', 'parent', &Any(), 'constraint', sub { ; } )
43 0 0 0 $TYPES{'Undef'} ||= 'Type::Nano'->new('name', 'Undef', 'parent', &Any(), 'constraint', sub { ; } )
51 0 0 0 $TYPES{'Ref'} ||= 'Type::Nano'->new('name', 'Ref', 'parent', &Defined(), 'constraint', sub { ; } )
59 0 0 0 $TYPES{'ArrayRef'} ||= 'Type::Nano'->new('name', 'ArrayRef', 'parent', &Ref(), 'constraint', sub { ; } )
67 0 0 0 $TYPES{'HashRef'} ||= 'Type::Nano'->new('name', 'HashRef', 'parent', &Ref(), 'constraint', sub { ; } )
75 0 0 0 $TYPES{'CodeRef'} ||= 'Type::Nano'->new('name', 'CodeRef', 'parent', &Ref(), 'constraint', sub { ; } )
83 0 0 0 $TYPES{'Object'} ||= 'Type::Nano'->new('name', 'Object', 'parent', &Ref(), 'constraint', sub { ; } )
91 0 0 0 $TYPES{'Bool'} ||= 'Type::Nano'->new('name', 'Bool', 'parent', &Any(), 'constraint', sub { ; } )
99 0 2 0 $TYPES{'Str'} ||= 'Type::Nano'->new('name', 'Str', 'parent', &Defined(), 'constraint', sub { ; } )
107 0 2 0 $TYPES{'Num'} ||= 'Type::Nano'->new('name', 'Num', 'parent', &Str(), 'constraint', sub { ; } )
115 2 2 0 $TYPES{'Int'} ||= 'Type::Nano'->new('name', 'Int', 'parent', &Num(), 'constraint', sub { ; } )
124 0 0 0 $TYPES{'CLASS'}{$class} ||= 'Type::Nano'->new('name', $class, 'parent', &Object(), 'constraint', sub { $_->isa($class); } , 'class', $class)
133 0 0 0 $_->can('DOES') || $_->can('isa')
134 0 0 0 $TYPES{'ROLE'}{$role} ||= 'Type::Nano'->new('name', $role, 'parent', &Object(), 'constraint', sub { my $meth = $_->can('DOES') || $_->can('isa'); $_->$meth($role); } , 'role', $role)
146 0 0 0 $TYPES{'DUCK'}{$methods} ||= 'Type::Nano'->new('name', $name, 'parent', &Object(), 'constraint', sub { my $obj = $_; ($obj->can($_) or return !1) foreach (@methods); 1; } , 'methods', \@methods)
159 0 0 0 $TYPES{'ENUM'}{$values} ||= 'Type::Nano'->new('name', $name, 'parent', &Str(), 'constraint', sub { $_ =~ /$regexp/; } , 'values', \@values)