File Coverage

blib/lib/CPU/x86_64/InstructionWriter/Unknown.pm
Criterion Covered Total %
statement 9 14 64.2
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 4 75.0
pod 0 1 0.0
total 12 26 46.1


line stmt bran cond sub pod time code
1             package CPU::x86_64::InstructionWriter::Unknown;
2             $CPU::x86_64::InstructionWriter::Unknown::VERSION = '0.000_002'; # TRIAL
3              
4 14     14   58 $CPU::x86_64::InstructionWriter::Unknown::VERSION = '0.000002';use Moo 2;
  14         186  
  14         58  
5 14     14   2447 use Carp;
  14         17  
  14         606  
6 14     14   43 use Scalar::Util 'refaddr';
  14         20  
  14         1656  
7              
8             # ABSTRACT: Placeholder for a constant that will be assembled
9              
10             has name => ( is => 'rw' );
11              
12             sub bits {
13 0     0 0   my $self= shift;
14 0 0         return $self->{bits} unless @_;
15 0           my $val= shift;
16 0 0 0       !defined $self->{bits} || $self->{bits} == $val
17             or croak "Can't change bits from $self->{bits} to $val for unknown($self->{name})";
18 0           $self->{bits}= $val;
19             }
20              
21             has value => ( is => 'rw' );
22              
23             1;
24              
25             __END__