38 lines
640 B
Perl
38 lines
640 B
Perl
|
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;
|