Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test for RT #115724
  • Loading branch information
usev6 committed Oct 22, 2014
1 parent eae2dc7 commit 18a47ab
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions S06-operator-overloading/sub.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 73;
plan 74;

=begin pod
Expand All @@ -22,8 +22,6 @@ Testing operator overloading subroutines
'prefix operator overloading for new operator');
}



{
sub prefix:<±> ($thing) { return "AROUND$thing"; };
is ± "fish", "AROUNDfish", 'prefix operator overloading for new operator (unicode, latin-1 range)';
Expand Down Expand Up @@ -65,7 +63,7 @@ Testing operator overloading subroutines
{
my sub prefix:<->($thing) { return "CROSS$thing"; };
is(-"fish", "CROSSfish",
'prefix operator overloading for existing operator (but only lexically so we don\'t mess up runtime internals (needed at least for PIL2JS, probably for PIL-Run, too)');
'prefix operator overloading for existing operator (but only lexically so we don\'t mess up runtime internals (needed at least for PIL2JS, probably for PIL-Run, too)');
}
{
Expand All @@ -76,19 +74,19 @@ Testing operator overloading subroutines
{
sub infix:<C> ($text, $owner) { return "$text copyright $owner"; };
is "romeo & juliet" C "Shakespeare", "romeo & juliet copyright Shakespeare",
'infix operator overloading for new operator';
'infix operator overloading for new operator';
}
{
sub infix:<©> ($text, $owner) { return "$text Copyright $owner"; };
is "romeo & juliet" © "Shakespeare", "romeo & juliet Copyright Shakespeare",
'infix operator overloading for new operator (unicode)';
'infix operator overloading for new operator (unicode)';
}
{
sub infix:<(C)> ($text, $owner) { return "$text CopyRight $owner"; };
is EVAL(q[ "romeo & juliet" (C) "Shakespeare" ]), "romeo & juliet CopyRight Shakespeare",
'infix operator overloading for new operator (nasty)';
'infix operator overloading for new operator (nasty)';
}
{
Expand Down Expand Up @@ -439,6 +437,13 @@ Testing operator overloading subroutines
lives_ok { sub postfix:<\\>($) {} }, 'can declare operator with a backslash (2)';
}
# RT #115724
#?rakudo.parrot skip 'RT #115724'
{
lives_ok { sub circumfix:<w "> ($a) { }; },
'can define circumfix operator with a double quote (")';
}
done;
# vim: ft=perl6

0 comments on commit 18a47ab

Please sign in to comment.