1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test combinators.smart math kernel accessors ;
4 IN: combinators.smart.tests
9 [ [ test-bi ] output>array ] must-infer
10 [ { 9 11 } ] [ [ test-bi ] output>array ] unit-test
12 [ { 9 11 } [ + ] input<sequence ] must-infer
13 [ 20 ] [ { 9 11 } [ + ] input<sequence ] unit-test
15 [ 6 ] [ [ 1 2 3 ] [ + ] reduce-outputs ] unit-test
17 [ [ 1 2 3 ] [ + ] reduce-outputs ] must-infer
19 [ 6 ] [ [ 1 2 3 ] sum-outputs ] unit-test
23 [ "a" "b" ] "" append-outputs-as
28 [ ] "" append-outputs-as
38 [ { 1 } { 2 } { 3 } ] B{ } append-outputs-as
42 : nested-smart-combo-test ( -- array )
43 [ [ 1 2 ] output>array [ 3 4 ] output>array ] output>array ;
45 \ nested-smart-combo-test def>> must-infer
47 [ { { 1 2 } { 3 4 } } ] [ nested-smart-combo-test ] unit-test
49 [ 14 ] [ [ 1 2 3 ] [ sq ] [ + ] map-reduce-outputs ] unit-test