tests
This commit is contained in:
parent
90ba8991d2
commit
aa76655755
20
test-util.scm
Normal file
20
test-util.scm
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
(module test-util ()
|
||||||
|
(import scheme)
|
||||||
|
(import (chicken base))
|
||||||
|
(import (chicken syntax))
|
||||||
|
(import test)
|
||||||
|
(import util)
|
||||||
|
|
||||||
|
(test-group "util"
|
||||||
|
(test '(2 3 4) (map (curry + 1) '(1 2 3)))
|
||||||
|
(test 3 ((applied +) '(1 2)))
|
||||||
|
(test 2 ((thunk (+ 1 1))))
|
||||||
|
(test 5 ((just (lambda () 5)) 6 7 8))
|
||||||
|
(test-group "perhaps"
|
||||||
|
(test 3 (let ((v 2))
|
||||||
|
(perhaps (lambda (n)
|
||||||
|
(+ n 1)) v)))
|
||||||
|
(test #f (let ((v #f))
|
||||||
|
(perhaps (lambda (n)
|
||||||
|
(+ n 1)) v))))
|
||||||
|
(test 'apple-orange (compose-symbols 'apple 'orange))))
|
Loading…
Reference in New Issue
Block a user