Condition Coverage

blib/lib/Game/Entities.pm
Criterion Covered Total %
condition 31 46 67.3


or 2 conditions

line l !l condition
184 136 17 $self->{'components'}{$name} //= [[], [], []]
258 2 3 $_->[1][$i] // (next)
301 60 0 $dense->[$j] // die("Undefined in set")
302 60 0 $other->[1][$i] // die("Undefined in other")
314 1 1 prototype $comparator // ""
405 3 0 $map->{$a}[1] // []
3 0 $map->{$b}[1] // []
444 4 0 $set->[0] // []
452 14 4 $set->[0][$_] // "---"
12 6 $set->[1][$_] // "---"
12 6 &Scalar::Util::refaddr($component) // 0

or 3 conditions

line l !l&&r !l&&!r condition
165 1 1 204 not defined $type or ref $type
180 153 0 2 ref $component || Carp::croak('Component must be a reference')
279 18 1 0 $self->{'entities'}[$pos] // $guid + 1
283 6 0 0 $self->{'components'}{$name} // Carp::croak("Cannot sort ${name}: no such component in registry")
296 4 0 0 $self->{'components'}{$comparator} // Carp::croak("Cannot sort according to ${comparator}: no such component in registry")
387 4 9 0 $self->{'view_cache'}{"|$name|"} //= do { my $set = $self->{'components'}{$name}; my $comps = $set->[2]; "Game::Entities::View"->new(map({my($i, $e) = ($_, $set->[1][$_]); $self->$add_version($e), [$comps->[$i]];} 0 .. $#{$$set[1];})) }
401 3 3 0 $self->{'view_cache'}{"|" . join("|", @types) . "|"} //= do { my $map = $self->{'components'}; my($short, @rest) = (sort {@{$map->{$a}[1] // [];} <=> @{$map->{$b}[1] // [];};} @types); my $set = $self->{'components'}{$short}; my $comps = $set->[2]; my @view; while (my($i, $e) = each @{$$set[1];}) { do { my $guid = $self->$add_version($e); next unless &List::Util::all(sub { $self->check($guid, $_); } , @rest); push @view, $guid, [map({$_ eq $short ? $comps->[$i] : $self->$get(1, $guid, $_);} @types)] }; } ; "Game::Entities::View"->new(@view) }
446 4 0 0 not @types or @names > 1