add test for `for`
This commit is contained in:
parent
561cfc9816
commit
0842983363
|
@ -1,2 +1,4 @@
|
|||
file(GLOB FOR_FILES ${PROJECT_SOURCE_DIR}/contrib/20.for/piclib/*.scm)
|
||||
list(APPEND PICLIB_CONTRIB_LIBS ${FOR_FILES})
|
||||
add_custom_target(test-for for test in ${PROJECT_SOURCE_DIR}/contrib/20.for/t/*.scm \; do bin/picrin "$$test" \; done DEPENDS repl)
|
||||
set(CONTRIB_TESTS ${CONTRIB_TESTS} test-for)
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
(import (scheme base)
|
||||
(picrin control list)
|
||||
(picrin test))
|
||||
|
||||
(test '(1 2 3)
|
||||
(for
|
||||
(yield (in '(1 2 3)))))
|
||||
|
||||
(test '((1 a) (1 b) (1 c) (2 a) (2 b) (2 c) (3 a) (3 b) (3 c))
|
||||
(for
|
||||
(let ((n (in '(1 2 3)))
|
||||
(c (in '(a b c))))
|
||||
(yield (list n c)))))
|
Loading…
Reference in New Issue