6
use Test::More tests => 1;
9
use String::ShellQuote;
11
use Games::Solitaire::Verify::Solution;
13
sub verify_solution_test
15
local $Test::Builder::Level = $Test::Builder::Level + 1;
20
my $deal = $args->{deal};
22
if ($deal !~ m{\A[1-9][0-9]*\z})
24
confess "Invalid deal $deal";
27
my $theme = $args->{theme} || ["-l", "gi"];
29
my $variant = $args->{variant} || "freecell";
31
my $fc_solve_exe = shell_quote($ENV{'FCS_PATH'} . "/fc-solve");
33
open my $fc_solve_output,
34
"make_pysol_freecell_board.py $deal $variant | " .
35
"$fc_solve_exe -g $variant " . shell_quote(@$theme) . " -p -t -sam |"
36
or Carp::confess "Error! Could not open the fc-solve pipeline";
39
my $solution = Games::Solitaire::Verify::Solution->new(
41
input_fh => $fc_solve_output,
46
my $verdict = $solution->verify();
47
my $test_verdict = ok (!$verdict, $msg);
51
diag("Verdict == " . Dumper($verdict));
54
close($fc_solve_output);
59
my $range_solver = $ENV{'FCS_PATH'} . "/freecell-solver-range-parallel-solve";
62
ok (!system($range_solver, "1", "20", "10", "-l", "gi"), "Range solver was successful");