23 lines
491 B
Raku
23 lines
491 B
Raku
use lib qw~ . ~;
|
|
|
|
use Part1;
|
|
use Part2;
|
|
|
|
use Test2::V0;
|
|
use Path::Tiny;
|
|
|
|
my @sample_reports = Day2::Part1::read_file( path('sample')->lines );
|
|
my @reports = Day2::Part1::read_file( path('input')->lines );
|
|
|
|
subtest 'part 1' => sub {
|
|
is Day2::Part1::is_safe(qw/ 7 6 4 2 1 /) => 1;
|
|
is Day2::Part1::solve(@sample_reports) => 2;
|
|
is Day2::Part1::solve(@reports) => 598;
|
|
};
|
|
|
|
subtest 'part 2' => sub {
|
|
is Day2::Part2::solve(@reports) => 634;
|
|
};
|
|
|
|
done_testing();
|