1 ! (c)2009 Joe Groff bsd license
2 USING: arrays kernel make sequences sequences.product tools.test ;
3 IN: sequences.product.tests
6 [ { { 0 "a" } { 1 "a" } { 2 "a" } { 0 "b" } { 1 "b" } { 2 "b" } } ]
7 [ { { 0 1 2 } { "a" "b" } } <product-sequence> >array ] unit-test
9 : x ( n s -- sss ) <repetition> concat ;
11 [ { "a" "aa" "aaa" "b" "bb" "bbb" } ]
12 [ { { 1 2 3 } { "a" "b" } } [ first2 x ] product-map ] unit-test
16 { 0 "a" t } { 1 "a" t } { 2 "a" t } { 0 "b" t } { 1 "b" t } { 2 "b" t }
17 { 0 "a" f } { 1 "a" f } { 2 "a" f } { 0 "b" f } { 1 "b" f } { 2 "b" f }
19 ] [ { { 0 1 2 } { "a" "b" } { t f } } [ ] product-map ] unit-test
23 { { "a" "b" "c" } { "1" "2" } }
24 [ [ % ] each ] product-each