Branch Coverage

blib/lib/MooX/Cmd/Tester.pm
Criterion Covered Total %
branch 28 38 73.6


line true false branch
24 0 0 unless $TEST_IN_PROGRESS
36 3 25 defined $result->{'error'} ? :
40 0 28 if $result->{'error'} and eval { do { $result->{'error'}->isa('MooX::Cmd::Tester::Exited') } }
55 0 16 unless &ok(!$rv->error, "Everythink ok running cmd $test_ident")
61 10 6 if $rv and not $rv->error and $rv->cmd and $rv->cmd->command_name
71 0 28 if ($^O eq 'MSWin32') { }
94 3 25 unless eval { do { local $TEST_IN_PROGRESS = 1; local(@ARGV) = @$argv; my $tb = $CLASS->builder; $cmd = ref $app ? $app : $app->new_with_cmd; $app = ref $app if ref $app; my $test_ident = "$app => [ " . join(' ', @$argv) . ' ]'; &ok(scalar $cmd->isa($app), "got a '${app}' from new_with_cmd"); &ok(scalar grep({index($cmd_name, $_) != -1;} @$argv), "proper cmd name from $test_ident") if @$argv and defined($cmd_name = $cmd->command_name); &ok(scalar @{$cmd->command_chain;} <= 1 + scalar(@$argv), "\$#argv vs. command chain length testing $test_ident"); &ok($cmd->command_chain_end == $cmd->command_chain->[-1], 'command_chain_end ok') if @$argv; unless ($execute_rv = $cmd->execute_return) { my($command_execute_from_new, $command_execute_method_name); my $cce = $cmd->can('command_chain_end'); $cce = &$cce($cmd) if $cce; $command_execute_from_new = $cce->can('command_execute_from_new') if $cce; $command_execute_from_new = &$command_execute_from_new($cce) if $command_execute_from_new; $command_execute_method_name = $cce->can('command_execute_method_name') unless $command_execute_from_new; $execute_rv = [$cce->can(&$command_execute_method_name($cce))->($cce)] if $command_execute_method_name; } ; 1 } }
100 8 20 ref $app ? :
101 8 17 if ref $app
106 16 9 if @$argv and defined($cmd_name = $cmd->command_name)
108 16 9 if @$argv
110 9 16 unless ($execute_rv = $cmd->execute_return)
114 9 0 if $cce
115 9 0 if $cce
116 6 3 if $command_execute_from_new
117 9 0 unless $command_execute_from_new
118 6 3 if $command_execute_method_name
123 3 25 if $@
163 0 0 unless defined $code