Acme-Globule
view release on metacpan or search on metacpan
t/59_range_mykeys.t view on Meta::CPAN
#!/usr/bin/env perl
use warnings;
use strict;
# Test that using the module doesn't break normal use of glob
use Test::More tests => 6;
use Acme::Globule qw( Range );
sub my_keys(\%) {
my @hash = %{ $_[0] };
return @hash[ glob("0,2..$#hash") ];
}
sub my_values(\%) {
my @hash = %{ $_[0] };
return @hash[ glob("1,3..$#hash") ];
}
my %hash = ( 1..20 );
is_deeply( [ my_keys %hash ], [ keys %hash ], 'my_keys works');
is_deeply( [ my_values %hash ], [ values %hash ], 'my_values works');
%hash = (1, 2);
( run in 0.240 second using v1.01-cache-2.11-cpan-65fba6d93b7 )