adventofcode/2023/08/part1.t

36 lines
622 B
Perl
Raw Permalink Normal View History

2023-12-08 15:31:44 +00:00
use 5.38.0;
use Test2::V0;
use Path::Tiny;
use File::Serialize;
use Part1;
2023-12-08 15:52:54 +00:00
use Part2;
2023-12-08 15:31:44 +00:00
2023-12-08 15:35:08 +00:00
my $input = path('input')->slurp;
my $example = path('example')->slurp;
2023-12-08 15:31:44 +00:00
my %solutions = deserialize_file('solutions.yml')->%*;
my $parsed = Part1::parse_input($example);
2023-12-08 15:35:08 +00:00
is $parsed->{directions} => [ 1, 0 ];
is $parsed->{nodes}{AAA} => [qw/ BBB CCC /];
2023-12-08 15:31:44 +00:00
2023-12-08 15:35:08 +00:00
is Part1::solution_1($example) => 2;
is Part1::solution_1(<<'END') => 6;
2023-12-08 15:31:44 +00:00
LLR
AAA = (BBB, BBB)
BBB = (AAA, ZZZ)
ZZZ = (ZZZ, ZZZ)
END
2023-12-08 15:35:08 +00:00
SKIP: {
# skip "not there yet" if $solutions{1} eq 'TODO';
2023-12-08 15:31:44 +00:00
is Part1::solution_1($input) => $solutions{1};
}
2023-12-08 15:52:54 +00:00
2023-12-08 15:31:44 +00:00
done_testing;