Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (16 sloc) 0.565 kB
use v6;
use Test;
plan 6;
#L<S03/"Smart matching"/Array Hash hash slice existence>
#?rakudo skip 'RT #124444'
{
my %h = (a => 'b', c => Mu);
ok (['a'] ~~ %h), 'Array ~~ Hash (exists and True)';
ok (['c'] ~~ %h), 'Array ~~ Hash (exists but Mu)';
ok ([<a c>] ~~ %h), 'Array ~~ Hash (both exist)';
ok ([<c d>] ~~ %h), 'Array ~~ Hash (one exists)';
# note that ?any() evaluates to False
ok !( () ~~ %h), 'Array ~~ Hash (empty list)';
ok !(['e'] ~~ %h), 'Array ~~ Hash (not exists)';
}
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.