28 lines
578 B
Perl
28 lines
578 B
Perl
use lib qw~ . ~;
|
|
|
|
use Part1;
|
|
use Part2;
|
|
|
|
use Test2::V0;
|
|
use Path::Tiny;
|
|
use File::Serialize;
|
|
|
|
my $solutions = deserialize_file './solutions.yml';
|
|
|
|
my $sample = -f 'sample' && Part1::read_input( path('sample') );
|
|
my $input= -f 'input' && Part1::read_input( path('input') );
|
|
|
|
subtest 'part 1' => sub {
|
|
is Part1::solve($sample) => 3749;
|
|
|
|
ok Part1::solve($input) > 14711898485202;
|
|
is Part1::solve($input) => $solutions->{part1};
|
|
};
|
|
|
|
subtest 'part 2' => sub {
|
|
is Part2::solve($sample) => 11387;
|
|
is Part2::solve($input) => $solutions->{part2};
|
|
};
|
|
|
|
done_testing();
|