Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test autogen of prefix and postfix hypers
  • Loading branch information
TimToady committed Oct 30, 2015
1 parent 5fc4c28 commit 3052bb6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion S03-metaops/hyper.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 390;
plan 392;

=begin pod
Expand Down Expand Up @@ -1017,9 +1017,15 @@ throws-like '3 «.» foo', X::Obsolete, "«.» can't be hypered";
'hyper op works with (finite) range on non-magical side (3)';
}

my &pre = &prefix:<>;
is pre((2,3,4)).gist, '(-2 -3 -4)', "Hyper prefix can autogen";

is-deeply &infix:<»+«>((1,2,3),(4,5,6)), (5, 7, 9), "Hyper >><< can autogen";
is-deeply &infix:<»+»>((1,2,3),1), (2, 3, 4), "Hyper >>>> can autogen";
is-deeply &infix:<«+«>(1,(4,5,6)), (5, 6, 7), "Hyper <<<< can autogen";
is-deeply &infix:<«+»>((1,2),(4,5,6)), (5, 7, 7), "Hyper <<>> can autogen";

my &post = &postfix:<»i>;
is post((2,3,4)).gist, '(0+2i 0+3i 0+4i)', "Hyper postfix can autogen";

# vim: ft=perl6

0 comments on commit 3052bb6

Please sign in to comment.