Navigation Menu

Skip to content

Commit

Permalink
Skip slice tests if hash slices are unsupported.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed May 18, 2016
1 parent d3fb953 commit f3303a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions t/slices.t
@@ -1,7 +1,9 @@
use Test::More tests=> 12;
use Test::More;

BEGIN { use_ok 'Tie::Hash::Regex' };

plan skip_all => 'Old Perl' if $] lt '5.020';

my %hash : Regex;

$hash{ key1 } = "one";
Expand All @@ -28,11 +30,10 @@ undef %ones;

($one, $two) = @hash{ qr/^key\d$/ };

is( $one, $hash{ key1 }, 'Slice test 1' );

TODO: {
local $TODO = q[This doesn't work];

is( $one, $hash{ key1 }, 'Slice test 1' );
is( $two, $hash{ key2 }, 'Slice test 2' );

%ones = %hash{ qr/^key1+$/ };
Expand All @@ -52,3 +53,5 @@ TODO: {

ok( ! defined $oops[0], 'Deletion test 3' );
}

done_testing();

0 comments on commit f3303a4

Please sign in to comment.