Skip to content

Commit 2f73cfa

Browse files
authored
Merge pull request #258 from FCO/test-131009
Test triangle reduce with listinfix op. RT #131009
2 parents bc790e4 + fbe36ef commit 2f73cfa

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

S03-metaops/reduce.t

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 547;
3+
plan 556;
44

55
=begin pod
66
@@ -681,4 +681,53 @@ is prefix:<[**]>(2,3,4), 2417851639229258349412352, "Reduce ** can autogen witho
681681
is ([*] CustomNumify.new), 42, 'one-argument [*] numifies';
682682
}
683683

684+
# RT #131009
685+
{
686+
cmp-ok [\X~](<a b c>),
687+
&infix:<eqv>,
688+
((("a",).Seq, ("ab",).Seq, ("abc",).Seq)).Seq,
689+
"Triangle reduce X~ 1 lists"
690+
;
691+
cmp-ok [\X~](<a b c>, <1 2 3>),
692+
&infix:<eqv>,
693+
((("abc",).Seq, (<a1 a2 a3 b1 b2 b3 c1 c2 c3>).Seq)).Seq,
694+
"Triangle reduce X~ 2 lists"
695+
;
696+
cmp-ok [\X~](<a b c>, <1 2 3>, <x y z>),
697+
&infix:<eqv>,
698+
((
699+
("abc",).Seq,
700+
(<a1 a2 a3 b1 b2 b3 c1 c2 c3>).Seq,
701+
(<a1x a1y a1z a2x a2y a2z a3x a3y a3z
702+
b1x b1y b1z b2x b2y b2z b3x b3y b3z
703+
c1x c1y c1z c2x c2y c2z c3x c3y c3z>).Seq,
704+
)).Seq,
705+
"Triangle reduce X~ 3 lists"
706+
;
707+
708+
cmp-ok [\Z~](<a b c>),
709+
&infix:<eqv>,
710+
((("a",).Seq, ("ab",).Seq, ("abc",).Seq)).Seq,
711+
"Triangle reduce Z~ 1 lists"
712+
;
713+
cmp-ok [\Z~](<a b c>, <1 2 3>),
714+
&infix:<eqv>,
715+
((("abc",).Seq, (<a1 b2 c3>).Seq)).Seq,
716+
"Triangle reduce Z~ 2 lists"
717+
;
718+
cmp-ok [\Z~](<a b c>, <1 2 3>, <x y z>),
719+
&infix:<eqv>,
720+
((
721+
("abc",).Seq,
722+
(<a1 b2 c3>).Seq,
723+
(<a1x b2y c3z>).Seq,
724+
)).Seq,
725+
"Triangle reduce Z~ 3 lists"
726+
;
727+
728+
is-deeply [\minmax]((1, 2, 3)) , (1..1, 1..2, 1..3).Seq , "Triangle reduce minmax";
729+
is-deeply [\minmax]((1, 2, 3), (-1, -2, -3)) , (1..3, -3..3).Seq , "Triangle reduce minmax";
730+
is-deeply [\minmax]((1, 2, 3), (-1, -2, -3), (1, 10, 100)) , (1..3, -3..3, -3..100).Seq, "Triangle reduce minmax";
731+
}
732+
684733
# vim: ft=perl6 et

0 commit comments

Comments
 (0)