Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (25 sloc) 0.652 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 8;
e67eb0c [t/spec] split S03-operators/smartmatch.t into S03-smartmatch/*.t
kyle authored
4
5 #L<S03/Smart matching/Any Any scalars are identical>
6 {
7 class Smartmatch::ObjTest {}
8 my $a = Smartmatch::ObjTest.new;
9 my $b = Smartmatch::ObjTest.new;
10 ok ($a ~~ $a), 'Any ~~ Any (+)';
11 ok !($a !~~ $a), 'Any !~~ Any (-)';
12 ok !($a ~~ $b), 'Any ~~ Any (-)';
13 ok ($a !~~ $b), 'Any !~~ Any (+)';
14 }
15
4fdfb46 [t/spec] test for RT #77134, !~~ did not set $_ to the LHS
moritz authored
16
17 {
18 $_ = 42;
19 my $x;
20 'abc' ~~ ($x = $_);
21 is $x, 'abc', '~~ sets $_ to the LHS';
22 is $_, 42, 'original $_ restored';
23 'defg' !~~ ($x = $_);
24 is $x, 'defg', '!~~ sets $_ to the LHS';
25 is $_, 42, 'original $_ restored';
26 'defg' !~~ ($x = $_);
27 }
28
e67eb0c [t/spec] split S03-operators/smartmatch.t into S03-smartmatch/*.t
kyle authored
29 # vim: ft=perl6
Something went wrong with that request. Please try again.