File Coverage

blib/lib/Games/Solitaire/Verify/App/Golf.pm
Criterion Covered Total %
statement 15 25 60.0
branch n/a
condition n/a
subroutine 5 7 71.4
pod 1 1 100.0
total 21 33 63.6


line stmt bran cond sub pod time code
1             package Games::Solitaire::Verify::App::Golf;
2             $Games::Solitaire::Verify::App::Golf::VERSION = '0.2601';
3 1     1   413760 use strict;
  1         2  
  1         45  
4 1     1   5 use warnings;
  1         3  
  1         75  
5 1     1   602 use autodie;
  1         21913  
  1         5  
6              
7 1     1   11096 use Games::Solitaire::Verify::Golf ();
  1         5  
  1         45  
8 1     1   1056 use Path::Tiny qw/ path /;
  1         18380  
  1         307  
9              
10              
11             sub run
12             {
13 0     0 1   my ( $self, $args ) = @_;
14 0           my ( $board_fn, $solution_fn ) = @ARGV;
15 0           my $verifier = Games::Solitaire::Verify::Golf->new(
16             {
17             board_string => path($board_fn)->slurp_raw(),
18             %$args,
19             }
20             );
21              
22 0           open my $fh, '<', $solution_fn;
23 0     0     $verifier->process_solution( sub { my $l = <$fh>; chomp $l; return $l; } );
  0            
  0            
  0            
24 0           print "Solution is OK.\n";
25 0           exit(0);
26             }
27              
28             1;
29              
30             __END__