Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (16 sloc) 0.612 kb
e67eb0c [t/spec] split S03-operators/smartmatch.t into S03-smartmatch/*.t
kyle authored
1 use v6;
2 use Test;
643bc98 replace plan *; with number of tests S03
mberends authored
3 plan 7;
e67eb0c [t/spec] split S03-operators/smartmatch.t into S03-smartmatch/*.t
kyle authored
4
5 #L<S03/Smart matching/Hash Pair test hash mapping>
6 {
7 my %a = (a => 1, b => 'foo', c => Mu);
8 ok (%a ~~ b => 'foo'), '%hash ~~ Pair (Str, +)';
9 ok !(%a ~~ b => 'ugh'), '%hash ~~ Pair (Str, -)';
10 ok (%a ~~ a => 1.0), '%hash ~~ Pair (Num, +)';
11 ok (%a ~~ :b<foo>), '%hash ~~ Colonpair';
68b538f Moritz Lenz remove last remnants of .notdef
moritz authored
12 ok (%a ~~ c => !*.defined), '%hash ~~ Pair (!*.defined, Mu)';
13 ok (%a ~~ d => !*.defined), '%hash ~~ Pair (!*.defined, Nil)';
e67eb0c [t/spec] split S03-operators/smartmatch.t into S03-smartmatch/*.t
kyle authored
14 ok !(%a ~~ a => 'foo'), '%hash ~~ Pair (key and val not paired)';
15 }
16
e76dd4c Moritz Lenz s/done_testing/done/ as per recent S24 changes
moritz authored
17 done;
e67eb0c [t/spec] split S03-operators/smartmatch.t into S03-smartmatch/*.t
kyle authored
18
19 # vim: ft=perl6
Something went wrong with that request. Please try again.