adventofcode/2023/07/part1.t

26 lines
551 B
Perl
Raw Normal View History

2023-12-07 15:01:29 +00:00
use 5.38.0;
use Test2::V0;
use Path::Tiny;
use Part1;
2023-12-07 16:23:53 +00:00
my $input = path('input')->slurp;
2023-12-07 15:33:30 +00:00
my $example = path('example')->slurp;
2023-12-07 15:01:29 +00:00
2023-12-07 16:23:53 +00:00
is Part1::rank_hand('AAAAA') => 7;
is Part1::rank_hand('AA8AA') => 6;
is Part1::rank_hand('23332') => 5;
is Part1::rank_hand('TTT98') => 4;
is Part1::rank_hand('23432') => 3;
is Part1::rank_hand('A23A4') => 2;
is Part1::rank_hand('23456') => 1;
2023-12-07 15:33:30 +00:00
2023-12-07 16:23:53 +00:00
is [ Part1::parse_input('2345A 123') ] => [ [ [qw/ a b c d m /], 123 ] ];
2023-12-07 15:33:30 +00:00
is Part1::solution_1($example) => 6440;
2023-12-07 16:23:53 +00:00
is Part1::solution_1($input) => 'TODO';
2023-12-07 15:01:29 +00:00
done_testing;