Skip to content

Commit c892865

Browse files
committed
Add test for RT #114886
1 parent f848a52 commit c892865

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

S06-multi/syntax.t

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

33
use Test;
44

5-
plan 40;
5+
plan 41;
66

77
# L<S06/Routine modifiers/>
88
# L<S06/Parameters and arguments/>
@@ -165,6 +165,19 @@ multi with_cap($a,$b,|cap) { return with_cap($a + $b, |cap) }
165165
#?pugs skip 'with_cap not found'
166166
is with_cap(1,2,3,4,5,6), 21, 'captures in multi sigs work';
167167

168+
#RT #114886 - order of declaration matters
169+
{
170+
multi sub fizzbuzz(Int $ where * %% 15) { 'FizzBuzz' };
171+
multi sub fizzbuzz(Int $ where * %% 5) { 'Buzz' };
172+
multi sub fizzbuzz(Int $ where * %% 3) { 'Fizz' };
173+
multi sub fizzbuzz(Int $number) { $number };
174+
is
175+
(1,3,5,15).map(&fizzbuzz).join(" "),
176+
<1 Fizz Buzz FizzBuzz>,
177+
"ordered multi subs";
178+
}
179+
180+
168181
done;
169182

170183
# vim: ft=perl6

0 commit comments

Comments
 (0)