Branch Coverage

lib/BalanceOfPower/Commands.pm
Criterion Covered Total %
branch 79 306 25.8


line true false branch
69 0 0 if ($player) { }
107 0 0 if ($self->executive)
115 0 0 if ($controlled)
120 0 0 if ($controlled)
123 0 0 if $player->get_control_order($controlled)
126 0 0 $self->nation ? :
133 0 0 if ($self->query)
153 0 0 if ($self->keep_query) { }
167 2 0 unless $query
188 0 2 if ($query eq 'turn') { }
250 0 5 if ($query eq 'quit') { }
0 5 elsif ($query eq 'nations') { }
1 4 elsif ($query eq 'years') { }
0 4 elsif ($query eq 'clear') { }
1 3 elsif ($query eq 'commands') { }
1 2 elsif ($query eq 'wars') { }
0 2 elsif ($query eq 'crises') { }
0 2 elsif ($query eq 'alliances') { }
0 2 elsif ($query eq 'static') { }
0 2 elsif ($query eq 'influences') { }
0 2 elsif ($query eq 'hotspots') { }
0 2 elsif ($query eq 'war history') { }
0 2 elsif ($query eq 'civil war history') { }
0 2 elsif ($query eq 'treaties') { }
0 2 elsif ($query =~ /^situation( (.*))?$/) { }
0 2 elsif ($query eq 'supports') { }
0 2 elsif ($query eq 'rebel supports') { }
0 2 elsif ($query =~ /save( (.*))?$/) { }
0 2 elsif ($query =~ /^distance (.*)-(.*)$/) { }
0 2 elsif ($query =~ /^((.*) )?borders$/) { }
0 2 elsif ($query =~ /^((.*) )?near$/) { }
0 2 elsif ($query =~ /^((.*) )?relations$/) { }
0 2 elsif ($query =~ m[^((.*) )?events( ((\d+)(/\d+)?))?$]) { }
0 2 elsif ($query =~ /^((.*) )?status$/) { }
0 2 elsif ($query =~ /^((.*) )?history$/) { }
0 2 elsif ($query =~ /^((.*) )?plot (.*)$/) { }
0 2 elsif ($query eq 'targets') { }
0 2 elsif ($query =~ /^friends( (.*))?$/) { }
372 0 0 if ($self->verify_nation($n1) and $self->verify_nation($n2))
381 0 0 if ($input_nation)
385 0 0 if ($self->nation) { }
398 0 0 if ($input_nation)
402 0 0 if ($self->nation) { }
415 0 0 if ($input_nation)
419 0 0 if ($self->nation) { }
434 0 0 if ($input_nation)
438 0 0 if ($self->nation) { }
440 0 0 if ($input_year) { }
446 0 0 if $t ne $turns[-1]
458 0 0 if ($input_year) { }
475 0 0 if ($input_nation) { }
0 0 elsif ($self->nation) { }
490 0 0 if ($input_nation)
494 0 0 if ($self->nation) { }
507 0 0 if ($input_nation)
511 0 0 if ($self->nation) { }
535 0 2 if ($self->verify_nation($nation_query)) { }
544 0 2 if ($query =~ m[^(\d+)(/\d+)?])
546 0 0 if (compare_turns($query, $self->world->current_year) == 0 || compare_turns($query, $self->world->current_year) == -1 and compare_turns($query, $self->world->first_year) >= 0)
549 0 0 if ($self->nation) { }
561 0 0 if $t ne $turns[-1]
577 0 0 if ($self->executive and $self->executive->actor) { }
579 0 0 if ($self->get_active_player->influence($self->executive->actor) >= 1) { }
601 2 2 if ($query =~ /^buy\s+(\d+)(\s+(.*))?$/)
604 2 0 if ($stock_nation) { }
613 2 0 if ($stock_nation)
616 1 1 if ($result->{'status'} == 1)
622 1 3 if ($query =~ /^sell\s+(\d+)(\s+(.*))?$/) { }
0 3 elsif ($query eq 'market') { }
0 3 elsif ($query eq 'show stocks') { }
0 3 elsif ($query eq 'show stock orders') { }
0 3 elsif ($query eq 'empty stock orders') { }
0 3 elsif ($query =~ /^remove stock orders( (.*))?/) { }
0 3 elsif ($query =~ m[^stockevents( ((\d+)(/\d+)?))?$]) { }
625 1 0 if ($stock_nation) { }
634 1 0 if ($stock_nation)
637 1 0 if ($result->{'status'} == 1)
668 0 0 if ($stock_nation) { }
676 0 0 if ($stock_nation)
706 1 0 if ($query =~ /^control( (.*))$/) { }
0 0 elsif ($query =~ /^uncontrol$/) { }
0 0 elsif ($query =~ /^show control orders/) { }
0 0 elsif ($query eq 'orders') { }
0 0 elsif ($query eq 'clearorders') { }
710 1 0 if ($input_nation)
714 0 1 unless ($controlled_nation)
718 1 0 if ($controlled_nation)
720 0 1 if ($self->world->at_war($controlled_nation))
724 0 1 if ($self->world->at_civil_war($controlled_nation))
729 1 0 if ($player->influence($controlled_nation) > 0) { }
753 0 0 if ($self->executive)
761 0 0 if ($self->executive)
776 0 0 if ($query eq 'travels') { }
0 0 elsif ($query =~ /^go( (.*))$/) { }
785 0 0 if ($status != 1) { }
803 0 0 if ($query =~ /^prices( (.*))$/) { }
0 0 elsif ($query eq 'cargo') { }
0 0 elsif ($query =~ /^sbuy +([0-9]+) +(.*)$/) { }
0 0 elsif ($query =~ /^ssell +([0-9]+) +(.*?)( +(bm))?$/) { }
806 0 0 if ($input_nation) { }
824 0 0 if ($res == 1) { }
836 0 0 if ($4 and $4 eq 'bm')
841 0 0 if ($res == 1) { }
859 0 2 if ($self->handle_result('turn', $result))
865 0 2 if ($self->handle_result('report', $result))
871 1 1 if ($self->handle_result('stock', $result))
877 0 0 if ($self->handle_result('control', $result))
895 0 0 if ($self->handle_result('orders', $result))
907 0 0 unless defined $pre_decisions
908 0 0 if $pre_decisions
914 0 0 unless ($self->commands)
929 2 4 if ($type eq 'turn') { }
2 2 elsif ($type eq 'report') { }
2 0 elsif ($type eq 'stock') { }
0 0 elsif ($type eq 'control') { }
0 0 elsif ($type eq 'orders') { }
0 0 elsif ($type eq 'travel') { }
0 0 elsif ($type eq 'shop') { }
931 0 2 if ($result->{'status'} == 1) { }
936 0 0 if ($self->nation) { }
955 0 2 if ($result->{'status'} == 1) { }
0 2 elsif ($result->{'status'} == -1) { }
971 0 2 if ($result->{'status'} == -11) { }
0 2 elsif ($result->{'status'} == -12) { }
0 2 elsif ($result->{'status'} == -13) { }
1 1 elsif ($result->{'status'} == -14) { }
0 1 elsif ($result->{'status'} == -15) { }
0 1 elsif ($result->{'status'} == 1) { }
0 1 elsif ($result->{'status'} == 2) { }
1012 0 0 if ($result->{'status'} == 1)
1016 0 0 if ($result->{'status'} == 2) { }
0 0 elsif ($result->{'status'} == -1) { }
0 0 elsif ($result->{'status'} == -2) { }
0 0 elsif ($result->{'status'} == -3) { }
1042 0 0 if ($result->{'status'} == -1) { }
0 0 elsif ($result->{'status'} == -2) { }
0 0 elsif ($result->{'status'} == -3) { }
0 0 elsif ($result->{'status'} == -4) { }
0 0 elsif ($result->{'status'} == 1) { }
1079 0 0 if ($result->{'status'} == -1) { }
0 0 elsif ($result->{'status'} == -2) { }
0 0 elsif ($result->{'status'} == -3) { }
0 0 elsif ($result->{'status'} == 1) { }
0 0 elsif ($result->{'status'} == 2) { }
1112 0 0 if ($result->{'status'} == 1) { }
0 0 elsif ($result->{'status'} == 20) { }
0 0 elsif ($result->{'status'} == 30) { }
0 0 elsif ($result->{'status'} == -1) { }
0 0 elsif ($result->{'status'} == -10) { }
0 0 elsif ($result->{'status'} == -11) { }
0 0 elsif ($result->{'status'} == -12) { }
1146 0 0 if ($result->{'status'} == -13)
1151 0 0 if ($result->{'status'} == -14) { }