Get 100% code coverage
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 11 May 2018 19:02:48 +0000 (22:02 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 11 May 2018 19:02:48 +0000 (22:02 +0300)
lib/App/Scheme79asm.pm
t/Compiler.t

index 6a2b4857864f979147b8748d1d6c93e1b53f1b32..374a8a3f43af771517da7dec974c96f7e2bb798d 100644 (file)
@@ -121,9 +121,9 @@ sub print_binary16 {
        die "addr_bits + type_bits >= 16\n"if $self->{addr_bits} + $self->{type_bits} > 16;
 
        my $length = @{$self->{memory}};
-       print $fh pack 'n', $length or croak "Failed to print memory size: $!";
+       print $fh pack 'n', $length or croak "Failed to print memory size: $!"; # uncoverable branch true
        for (@{$self->{memory}}) {
-               print $fh pack 'n', $_ or croak "Failed to print memory: $!"
+               print $fh pack 'n', $_ or croak "Failed to print memory: $!" # uncoverable branch true
        }
 }
 
@@ -147,7 +147,7 @@ sub print_verilog {
 
                my $string = "mem[$index] <= $val;";
                $string .= "$spaces // $comment" if defined $comment;
-               say $fh $string or croak "Failed to print verilog: $!";
+               say $fh $string or croak "Failed to print verilog: $!"; # uncoverable branch true
        }
 
 }
index 847cdb2e72e5777e52479297a927164cc16b69bd..e50107aca0577c7c55aed950ba77d897d1bd0195 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use Data::Dump::Sexp;
-use Test::More tests => 31;
+use Test::More tests => 32;
 
 BEGIN { use_ok('App::Scheme79asm::Compiler') };
 
@@ -28,6 +28,7 @@ sub is_toplevel {
 }
 
 is_sexp new->process_quoted(to_sexp '5'), '(SYMBOL 3)', 'process_quoted 5';
+is_sexp new->process_quoted(to_sexp 'NIL'), '(LIST 0)', 'process_quoted NIL';
 is_sexp new->process_quoted(to_sexp '()'), '(LIST 0)', 'process_quoted ()';
 is_sexp new->process_quoted(to_sexp '(5 foo)'), '(LIST (LIST (LIST 0) (SYMBOL 3)) (SYMBOL 4))', 'process_quoted (5 foo)';
 is_sexp new->process_quoted(to_sexp '(((5)))'), '(LIST (LIST 0) (LIST (LIST 0) (LIST (LIST 0) (SYMBOL 3))))', 'process_quoted (((5)))';
This page took 0.014224 seconds and 4 git commands to generate.