Skip to content

Commit 7c4672c

Browse files
committed
Add tests for RT #116002
1 parent 28a9fc9 commit 7c4672c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

S02-types/capture.t

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 21;
5+
plan 24;
66

77
{
88
my $capture = \(1,2,3);
@@ -130,4 +130,19 @@ plan 21;
130130
# RT #89766
131131
nok (defined \()[0]), '\()[0] is not defined';
132132

133+
# RT #116002
134+
{
135+
class RT116002 {
136+
method foo (Int) {}
137+
}
138+
my @a = 42;
139+
140+
ok \(RT116002, 42) ~~ RT116002.^find_method("foo").signature,
141+
'capture with scalar matches signature';
142+
nok \(RT116002, @a) ~~ RT116002.^find_method("foo").signature,
143+
'capture with one element array does not match signature';
144+
ok \(RT116002, |@a) ~~ RT116002.^find_method("foo").signature,
145+
'capture with infix:<|> on one element array matches signature';
146+
}
147+
133148
# vim: ft=perl6

0 commit comments

Comments
 (0)