]> gitweb.factorcode.org Git - factor.git/blob - extra/cursors/cursors-tests.factor
Merge branch 'master' into global_optimization
[factor.git] / extra / cursors / cursors-tests.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: cursors math tools.test make ;
4 IN: cursors.tests
5
6 [ 2 t ] [ { 2 3 } [ even? ] find ] unit-test
7 [ 3 t ] [ { 2 3 } [ odd? ] find ] unit-test
8 [ f f ] [ { 2 4 } [ odd? ] find ] unit-test
9
10 [ { 2 3 } ] [ { 1 2 } [ 1 + ] map ] unit-test
11 [ { 2 3 } ] [ { 1 2 } [ [ 1 + , ] each ] { 2 3 } make ] unit-test
12
13 [ t ] [ { } [ odd? ] all? ] unit-test
14 [ t ] [ { 1 3 5 } [ odd? ] all? ] unit-test
15 [ f ] [ { 1 3 5 6 } [ odd? ] all? ] unit-test
16
17 [ t ] [ { } [ odd? ] all? ] unit-test
18 [ t ] [ { 1 3 5 } [ odd? ] any? ] unit-test
19 [ f ] [ { 2 4 6 } [ odd? ] any? ] unit-test
20
21 [ { 1 3 5 } ] [ { 1 2 3 4 5 6 } [ odd? ] filter ] unit-test