Skip to content

Commit

Permalink
Test dynamic operator names
Browse files Browse the repository at this point in the history
Tests for RT #68024
  • Loading branch information
MasterDuke17 committed Oct 2, 2016
1 parent 82115a3 commit d63dad7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S06-operator-overloading/infix.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 44;
plan 47;

{
sub infix:<×> ($a, $b) { $a * $b }
Expand Down Expand Up @@ -253,3 +253,13 @@ plan 44;

is infix:['+'](2,3), 5, 'can call existing infix via compile-time string lookup';
is infix:['Z~'](<a b>, <c d>), 'ac bd', 'can call autogen infix via compile-time string lookup';

# RT #68024
{
BEGIN my $plus = '+';
is &infix:<<$plus>>(3,4), 7, '&infix:<<$foo>> works';
is &infix:«$plus»(3,4), 7, '&infix:«$foo» works';
is &infix:[$plus](3,4), 7, '&infix:[$foo] works';
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit d63dad7

Please sign in to comment.