Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (16 sloc) 0.544 kb
use v6;
use Test;
plan 6;
#L<S03/"Smart matching"/Array Hash hash slice existence>
{
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)';
}
done;
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.