Branch Coverage

blib/lib/Language/RAM.pm
Criterion Covered Total %
branch 127 180 70.5


line true false branch
120 0 0 if $_ eq ''
122 0 0 unless defined $value
123 0 0 if $n_ip == -1
158 0 0 if @_ >= 3
165 0 0 if $_[3]
174 0 0 unless ($current)
178 0 0 unless (exists $machine->{'stats'}{'command_usage'}{$machine->{'ip'}})
183 0 0 if $_[3]
185 0 0 unless &eval($current, $machine, 0, $_[3])
191 0 0 if ($limit > 0 and $machine->{'steps'} == $limit)
294 0 0 unless exists $snapshots->{$_}[1]
342 0 0 unless exists $step->[1]
387 2 4 if ($l =~ /\A(\d+):\s*(.+)/)
396 3 3 if ($l =~ /\A(INPUT|OUTPUT)(.*)\Z/)
397 1 2 if ($2 eq '')
402 1 1 if ($1 eq 'INPUT') { }
432 4 6 if (index($_[0], ' ') != -1) { }
437 2 4 if $_ eq ''
439 0 4 unless $r
443 1 3 if (@{$ret;} == 0)
448 1 5 if ($_[0] =~ /\A(\d+)..(\d+)\Z/) { }
4 1 elsif ($_[0] =~ /\A(\d+)\Z/) { }
480 30 94 if ($_[0] =~ /\A(\-?\d+(?:\.\d+)?)\Z/) { }
62 32 elsif ($_[0] =~ /\A(a|i|i1|i2|i3)\Z/) { }
13 19 elsif ($_[0] =~ /\As\[\s*(.+?)\s*\]\Z/) { }
3 16 elsif ($_[0] =~ /\Ajump\s+(.+)\s*\Z/) { }
3 13 elsif ($_[0] =~ /\A(.+?)\s*<--?\s*(.+?)\s*\Z/) { }
2 11 elsif ($_[0] =~ /\A(.+?)\s*(<|<=|!?=|>=|>)\s*0\Z/) { }
0 11 elsif ($_[0] =~ /\Aif\s+(.+?)\s+then\s+(.+)\Z/) { }
11 0 elsif ($_[0] =~ /\A(.+?)\s*(\+|\-|\*|div|mod)\s*(.+)\Z/) { }
0 0 elsif ($_[0] eq 'HALT') { }
483 0 62 $1 eq 'i' ? :
578 0 18 unless my $left = &get_ast($_[0], $_[3], $_[4])
579 0 18 unless my $right = &get_ast($_[2], $_[3], $_[4])
581 1 17 unless $left->[0] eq 'reg'
584 1 16 unless exists $algo_right{$right->[0]}
588 1 10 unless $type or $right->[0] eq 'imm' and $_[1] eq '+' || $_[1] eq '-'
613 0 18 unless my $inner = &get_ast(@_)
615 6 12 if $inner->[0] eq 'imm'
617 10 2 if ($inner->[0] eq 'algo') { }
1 1 elsif ($inner->[0] eq 'reg' and $inner->[1] ne 'a') { }
618 1 9 unless $inner->[1] == 0
656 0 27 unless my $reg = &get_ast($_[0], $_[2], $_[3])
658 1 26 unless $reg->[0] eq 'reg'
683 0 5 unless my $dest = &get_ast(@_)
685 1 4 unless $dest->[0] eq 'imm'
720 0 3 unless my $cond = &get_ast($_[0], $_[2], $_[3])
722 1 2 unless $cond->[0] eq 'cond'
725 0 2 unless my $jump = &get_ast($_[1], $_[2], $_[3])
726 1 1 unless $jump->[0] eq 'jump'
763 0 15 unless my $left = &get_ast($_[0], $_[2], $_[3])
764 0 15 unless my $right = &get_ast($_[1], $_[2], $_[3])
766 10 5 if ($left->[0] eq 'reg') { }
2 3 elsif ($left->[0] eq 'mem') { }
2 1 elsif ($left->[0] eq 'mmem') { }
769 8 2 if ($left->[1] eq 'a') { }
770 1 7 unless $rcheck or exists $assign_a_right{$right->[0]}
773 1 1 unless $rcheck or $right->[0] eq 'algo'
776 1 0 unless not $right->[1] or $right->[0] ne 'algo'
779 1 1 unless $right->[0] eq 'reg'
782 1 1 unless $right->[0] eq 'reg' and $right->[1] eq 'a'
819 0 113 if ($_[0][0] eq 'halt')
822 113 0 if (exists $eval_funcs{$_[0][0]}) { }
873 6 81 unless (exists $_[1]{'memory'}{$_[0][1]})
879 75 12 unless ($_[2] // 0) > 0
880 10 2 if $_[2] == 1
895 0 13 unless defined(my $val = &eval($_[0][1], $_[1]))
918 0 32 unless defined(my $left = &eval($_[0][2], $_[1]))
919 0 32 unless defined(my $right = &eval($_[0][4], $_[1]))
921 17 15 if ($_[0][3] eq '+') { }
6 9 elsif ($_[0][3] eq '-') { }
3 6 elsif ($_[0][3] eq '*') { }
3 3 elsif ($_[0][3] eq 'div') { }
3 0 elsif ($_[0][3] eq 'mod') { }
956 0 20 unless defined(my $val = &eval($_[0][1], $_[1]))
958 4 16 if ($_[0][2] eq '<') { }
3 13 elsif ($_[0][2] eq '<=') { }
3 10 elsif ($_[0][2] eq '=') { }
3 7 elsif ($_[0][2] eq '!=') { }
3 4 elsif ($_[0][2] eq '>=') { }
4 0 elsif ($_[0][2] eq '>') { }
995 0 2 unless defined(my $cond = &eval($_[0][1], $_[1]))
996 1 1 if $cond
1019 0 2 unless defined(my $val = &eval($_[0][1], $_[1]))
1043 0 6 unless my $left = &eval($_[0][1], $_[1], 1)
1044 0 6 unless defined(my $right = &eval($_[0][2], $_[1]))
1046 0 6 if $_[1]{'snaps'}
1074 2 90 if ($_[2] // 0) == 2
1076 17 73 unless (exists $_[0]{'stats'}{'memory_usage'}{$_[1]})
1080 12 78 $_[2] ? :