factor/unmaintained/combinators-lib/lib-tests.factor

25 lines
722 B
Factor
Raw Normal View History

USING: combinators.lib kernel math random sequences tools.test continuations
arrays vectors ;
2008-03-01 17:00:45 -05:00
IN: combinators.lib.tests
2007-09-20 18:09:08 -04:00
[ 6 -1 ] [ 5 0 1 [ + ] [ - ] bi, bi* ] unit-test
[ 6 -1 1 ] [ 5 0 1 1 [ + ] [ - ] [ * ] tri, tri* ] unit-test
[ 5 4 ] [ 5 0 1 [ + ] [ - ] bi*, bi ] unit-test
[ 5 4 5 ] [ 5 0 1 1 [ + ] [ - ] [ * ] tri*, tri ] unit-test
2008-07-27 14:49:31 -04:00
[ 5 6 ] [ 5 0 1 [ + ] bi@, bi ] unit-test
[ 5 6 7 ] [ 5 0 1 2 [ + ] tri@, tri ] unit-test
2007-09-20 18:09:08 -04:00
[ 5 ] [ [ 10 random ] [ 5 = ] generate ] unit-test
[ t ] [ [ 10 random ] [ even? ] generate even? ] unit-test
2008-05-15 00:23:12 -04:00
[ { "foo" "xbarx" } ]
[
2008-12-06 19:58:05 -05:00
{ "oof" "bar" } { [ reverse ] [ "x" dup surround ] } parallel-call
2008-05-15 00:23:12 -04:00
] unit-test
2008-03-21 18:48:01 -04:00
{ 1 1 } [
[ even? ] [ drop 1 ] [ drop 2 ] ifte
] must-infer-as