use Test2::V0; use Test2::Plugin::ExitSummary; use FindBin qw($Bin); use lib "$Bin/../lib"; use BinaryGap; # plan(2); my %test_data = ( 1 => '0', 9 => '2', 529 => '4', 20 => '1', 15 => '0', 32 => '0', 1041 => '5', 6 => '0', 328 => '2', 51712 => '2', 20 => '1', ); plan(scalar(keys %test_data)); for my $key (keys %test_data) { my $binary_gap = BinaryGap::solution($key); is($binary_gap, $test_data{$key}, "Binary gap for $key is correct"); }