26 lines
551 B
Perl
26 lines
551 B
Perl
use 5.38.0;
|
|
|
|
use Test2::V0;
|
|
|
|
use Path::Tiny;
|
|
|
|
use Part1;
|
|
|
|
my $input = path('input')->slurp;
|
|
my $example = path('example')->slurp;
|
|
|
|
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;
|
|
|
|
is [ Part1::parse_input('2345A 123') ] => [ [ [qw/ a b c d m /], 123 ] ];
|
|
|
|
is Part1::solution_1($example) => 6440;
|
|
is Part1::solution_1($input) => 'TODO';
|
|
|
|
done_testing;
|