adventofcode/2023/08/part1.t

38 lines
640 B
Perl
Raw 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;
my $input = path('input')->slurp;
my $example = path('example')->slurp;
my %solutions = deserialize_file('solutions.yml')->%*;
my $parsed = Part1::parse_input($example);
use DDP; p $parsed;
is $parsed->{directions} => [1,0];
is $parsed->{nodes}{AAA} => [ qw/ BBB CCC /];
is Part1::solution_1($example) => 2;
is Part1::solution_1(<<'END') => 6;
LLR
AAA = (BBB, BBB)
BBB = (AAA, ZZZ)
ZZZ = (ZZZ, ZZZ)
END
SKIP: {
# skip "not there yet" if $solutions{1} eq 'TODO';
is Part1::solution_1($input) => $solutions{1};
}
done_testing;