2008-06-02 01:26:10 -04:00
|
|
|
! Copyright (C) 2008 James Cash
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2008-06-03 01:27:06 -04:00
|
|
|
USING: tools.test lists math ;
|
2008-06-02 01:26:10 -04:00
|
|
|
|
2008-06-03 01:27:06 -04:00
|
|
|
IN: lists.tests
|
2008-06-02 01:26:10 -04:00
|
|
|
|
|
|
|
{ { 3 4 5 6 } } [
|
|
|
|
T{ cons f 1
|
|
|
|
T{ cons f 2
|
|
|
|
T{ cons f 3
|
|
|
|
T{ cons f 4
|
2008-06-03 16:57:29 -04:00
|
|
|
T{ cons f f f } } } } } [ 2 + ] lmap
|
2008-06-03 01:27:06 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ 10 } [
|
|
|
|
T{ cons f 1
|
|
|
|
T{ cons f 2
|
|
|
|
T{ cons f 3
|
|
|
|
T{ cons f 4
|
2008-06-03 16:57:29 -04:00
|
|
|
T{ cons f f f } } } } } 0 [ + ] lreduce
|
2008-06-02 01:26:10 -04:00
|
|
|
] unit-test
|