Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 37 lines (26 sloc) 0.943 kb
e75ccb3 [t] move operators/brainos.t to spec/
moritz authored
1 use v6;
2
3 use Test;
4
cdf3825 [brainos.t] Added tests for RT #76878.
Kodi Arfer authored
5 plan 9;
e75ccb3 [t] move operators/brainos.t to spec/
moritz authored
6
7 =begin pod
8
9 Perl 6 has an explicitly declared C<=~> which should die at compile time
53e47dd [t/spec] Update S03-operators/braino.t.
jnthn authored
10 and is intended to catch user "brainos"; it recommends C<~~> to the user
11 instead. Similar for C<!~>.
e75ccb3 [t] move operators/brainos.t to spec/
moritz authored
12
13 =end pod
14
15 #L<S03/Chaining binary precedence/"To catch">
16
17 my $str = 'foo';
bb5077a @FROGGS eval => EVAL in S03 and S04
FROGGS authored
18 try { EVAL '$str =~ m/bar/;' };
79d8122 [t/spec] Better =~ braino tests for RT #61778
kyle authored
19 ok $! ~~ Exception, 'caught "=~" braino';
20 ok "$!" ~~ /'~~'/, 'error for "=~" usage mentions "~~"';
53e47dd [t/spec] Update S03-operators/braino.t.
jnthn authored
21
bb5077a @FROGGS eval => EVAL in S03 and S04
FROGGS authored
22 try { EVAL '$str !~ m/bar/;' };
53e47dd [t/spec] Update S03-operators/braino.t.
jnthn authored
23 ok $! ~~ Exception, 'caught "!~" braino';
24 ok "$!" ~~ /'!~~'/, 'error for "!~" usage mentions "!~~"';
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
25
cdf3825 [brainos.t] Added tests for RT #76878.
Kodi Arfer authored
26 # RT #76878
27 {
28 my $x = 2;
bb5077a @FROGGS eval => EVAL in S03 and S04
FROGGS authored
29 is EVAL('"$x =~ b"'), '2 =~ b', '=~ allowed in double quotes';
30 is EVAL('"$x !~ b"'), '2 !~ b', '!~ allowed in double quotes';
31 is EVAL('"$x << b"'), '2 << b', '<< allowed in double quotes';
32 is EVAL('"$x >> b"'), '2 >> b', '>> allowed in double quotes';
33 is EVAL('"$x . b"'), '2 . b', '. allowed in double quotes';
cdf3825 [brainos.t] Added tests for RT #76878.
Kodi Arfer authored
34 }
35
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
36 # vim: ft=perl6
Something went wrong with that request. Please try again.