Skip to content

Commit cfc0897

Browse files
committed
Add tests for RT #113884
1 parent 48a5a13 commit cfc0897

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

S05-metasyntax/longest-alternative.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 48;
4+
plan 50;
55

66
#L<S05/Unchanged syntactic features/"While the syntax of | does not change">
77

@@ -437,4 +437,15 @@ my $str = 'a' x 7;
437437
is ~$/, 'äaÄAÁ', 'got longest alternative with :i:m';
438438
}
439439

440+
# RT #113884
441+
{
442+
#?rakudo todo "RT #113884 - constant variables not counted in LTM yet"
443+
constant $x = 'ab';
444+
is ~('ab' ~~ / a | b | $x /), 'ab', 'got longest alternative with constant';
445+
446+
my $y = 'ab';
447+
is ~('ab' ~~ / a | b | $y /), 'a', "non constants don't count toward LTM";
448+
}
449+
450+
440451
# vim: ft=perl6 et

0 commit comments

Comments
 (0)