1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/usr/bin/perl
use v5.14;
use warnings;
use Test2::V0;
BEGIN {
plan skip_all => "Syntax::Keyword::Match >= 0.08 is not available"
unless eval { require Syntax::Keyword::Match;
Syntax::Keyword::Match->VERSION( '0.08' ); };
plan skip_all => "Syntax::Operator::Divides is not available"
unless eval { require Syntax::Operator::Divides };
Syntax::Keyword::Match->import;
Syntax::Operator::Divides->import;
}
# literals
{
my $ok;
match(15 : %%) {
case(5) { $ok++ }
case(6) { fail('Not this one sorry'); }
}
ok( $ok, 'Literal match' );
}
done_testing;
|