Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (23 sloc) 0.519 kB
use v6;
use Test;
=begin pod
Matching against an array or a hash.
=end pod
plan 8;
# Matching against an array should be true if any of the values match.
my @a = ('a', 'b' );
ok(@a ~~ / 'b' /);
#?niecza todo
ok(@a ~~ / ^ 'b' /);
ok(@a ~~ / ^ 'a' /);
#?niecza todo
ok(@a ~~ / ^ 'a' $ /);
# Matching against a hash should be true if any of the keys match.
my %a = ('a' => 1, 'b' => 2);
ok(%a ~~ / 'b' /);
#?niecza todo
ok(%a ~~ / ^ 'b' /);
ok(%a ~~ / ^ 'a' /);
#?niecza todo
ok(%a ~~ / ^ 'a' $ /);
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.