Branch Coverage

lib/BalanceOfPower/Role/Warlord.pm
Criterion Covered Total %
branch 77 106 72.6


line true false branch
62 92 165 if ($self->border_exists($nation1, $nation2))
71 11 1 unless ($hostile and $treaty)
73 7 4 if (not $self->war_busy($nation_supported)) { }
75 0 7 if ($nation_supported eq $nation2)
79 5 2 if ($self->border_exists($nation_supported, $nation2))
93 164 0 unless ($self->war_busy($ally))
95 1 163 if $ally eq $nation2
96 2 161 if $self->border_exists($ally, $nation2)
117 7 0 if (not $self->war_exists($attacker->name, $defender->name))
134 1 0 if ($ally->good_prey($defender, $self, 2, 0))
136 1 0 unless (grep {$_ eq $ally_name;} @attacker_coalition)
147 1 0 if ($ally->good_prey($attacker, $self, 2, 0))
149 1 0 unless (grep {$_ eq $ally_name;} @defender_coalition)
176 8 10 if ($faction == 0) { }
10 0 elsif ($faction == 1) { }
184 15 3 if (@potential_attackers == 0)
186 7 8 if ($faction0_done == 1 and $faction == 1 or $faction1_done == 1 and $faction == 0) { }
194 2 6 if ($faction == 0) { }
216 1 2 if ($faction == 0) { }
2 0 elsif ($faction == 1) { }
219 1 0 if (@potential_defenders == 0)
231 1 1 if (@potential_defenders == 0)
241 1 0 if (@potential_defenders > 0) { }
252 1 2 if ($defend_now)
259 1 2 if ($faction == 0) { }
290 0 1 if (exists $attacker_leaders{$c->[1]}) { }
301 0 1 if ($couples_factions[$faction_counter] == 0) { }
339 0 8 if ($sup1)
346 2 6 if ($sup2)
359 2 20 if ($supported)
373 1 21 if ($supported and $self->exists_treaty_by_type($attacker->name, $supported->node1, 'no aggression'))
381 32 31 if ($flip == 0) { }
383 2 30 if ($supported and $supported->army > 0)
398 1 21 if ($supported)
400 0 1 if ($supported->army <= 0)
418 11 0 unless (exists $war_bonds_issued{$w->node1})
423 11 0 unless (exists $war_bonds_issued{$w->node2})
438 11 0 $attacker_army >= 3 ? :
439 11 0 $defender_army >= 3 ? :
442 0 11 $attack < $defence ? :
446 0 11 if ($progress_delta > 0) { }
461 13 20 if ($att > $def) { }
470 0 11 if (my $sup = $self->supported($attacker->name))
473 0 0 unless ($self->exists_treaty_by_type($defender->name, $supporter_n, 'no aggression'))
478 2 9 if (my $sup = $self->supported($defender->name))
481 1 1 unless ($self->exists_treaty_by_type($attacker->name, $supporter_n, 'no aggression'))
491 1 10 if ($attacker->army == 0) { }
1 9 elsif ($defender->army == 0) { }
521 1 1 if ($w->node1 eq $loser) { }
1 0 elsif ($w->node2 eq $loser) { }
551 1 6 if (@conquerors > 0)
595 0 0 if (not $l =~ /^\s/) { }
597 0 0 if ($war_data) { }