2
2
3
3
use Test ;
4
4
5
- plan 17 ;
5
+ plan 18 ;
6
6
7
7
= begin description
8
8
@@ -30,7 +30,7 @@ is $got, 'x 123', 'called pointy immediately: -> $x { ... }(...)';
30
30
31
31
# L<S04/Statement-ending blocks/End-of-statement cannot occur within a bracketed expression>
32
32
my @ a ;
33
- lives_ok { @ a = (" one" , -> $ x { $ x ** 2 }, " three" )} ,
33
+ lives_ok { @ a = (" one" , -> $ x { $ x ** 2 }, " three" )} ,
34
34
' pointy sub without preceding comma' ;
35
35
is @ a [0 ], ' one' , ' pointy sub in list previous argument' ;
36
36
isa_ok @ a [1 ], Code , ' pointy sub in list' ;
@@ -39,7 +39,7 @@ is @a[2], 'three', 'pointy sub in list following argument';
39
39
40
40
# L<S06/""Pointy blocks""/behaves like a block with respect to control exceptions>
41
41
my $ n = 1 ;
42
- my $ s = -> {
42
+ my $ s = -> {
43
43
last if $ n == 10 ;
44
44
$ n ++ ;
45
45
redo if $ n < 10 ;
@@ -52,16 +52,16 @@ is $n, 10, "pointy control exceptions ran";
52
52
# L<S06/""Pointy blocks""/will return from the innermost enclosing sub or method>
53
53
my $ str = ' ' ;
54
54
55
- sub outer {
56
- my $ s = -> {
55
+ sub outer {
56
+ my $ s = -> {
57
57
# ?rakudo todo '&?ROUTINE'
58
58
# ?niecza todo 'Unable to resolve method name in class Sub'
59
- is (& ? ROUTINE . name , ' &Main::outer' , ' pointy still sees outer\' s &?ROUTINE' );
59
+ is (& ? ROUTINE . name , ' &Main::outer' , ' pointy still sees outer\' s &?ROUTINE' );
60
60
61
- $ str ~ = ' inner' ;
62
- return ' inner ret' ;
61
+ $ str ~ = ' inner' ;
62
+ return ' inner ret' ;
63
63
};
64
- $ s . ();
64
+ $ s . ();
65
65
$ str ~ = ' outer' ;
66
66
return ' outer ret' ;
67
67
}
@@ -81,11 +81,10 @@ is $str, 'inner', 'return in pointy returns from enclosing sub';
81
81
eval_dies_ok(q {{ -> { $^a, $^b } }} , ' -> { $^a, $^b } is illegal' );
82
82
83
83
# RT #61034
84
-
85
- lives_ok {my $ x = -> {}; my $ y = $ x (); },
84
+ lives_ok {my $ x = -> {}; my $ y = $ x (); },
86
85
' can define and execute empty pointy block' ;
87
86
88
- # The default type of pointy blocks is Mu, not Any. See
87
+ # The default type of pointy blocks is Mu, not Any. See
89
88
# http://www.nntp.perl.org/group/perl.perl6.language/2009/03/msg31181.html
90
89
# L<S02/Undefined types/default block parameter type>
91
90
# this means that junctions don't autothread over pointy blocks
@@ -102,9 +101,15 @@ lives_ok {my $x = -> {}; my $y = $x(); },
102
101
ok $ ok , ' Blocks receive junctions without autothreading' ;
103
102
is $ iterations , 1 , ' no autothreading happened' ;
104
103
my $ b = -> $ x { ... };
105
- ok $ b . signature . perl ! ~~ /Any /,
104
+ ok $ b . signature . perl ! ~~ /Any /,
106
105
' The .signature of a block does not contain Any' ;
107
106
}
108
107
109
- # vim: ft=perl6
108
+ # RT #115372
109
+ # ?rakudo.moar todo 'RT #115372'
110
+ {
111
+ throws_like q [ say -> {YOU_ARE_HERE} ] , X::Method::NotFound ,
112
+ ' no Segfault when putting YOU_ARE_HERE marker in a pointy block' ;
113
+ }
110
114
115
+ # vim: ft=perl6
0 commit comments