25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
565B

  1. (module test-util ()
  2. (import scheme)
  3. (import (chicken base))
  4. (import (chicken syntax))
  5. (import test)
  6. (import util)
  7. (test-group "util"
  8. (test '(2 3 4) (map (curry + 1) '(1 2 3)))
  9. (test 3 ((applied +) '(1 2)))
  10. (test 2 ((thunk (+ 1 1))))
  11. (test 5 ((just (lambda () 5)) 6 7 8))
  12. (test-group "perhaps"
  13. (test 3 (let ((v 2))
  14. (perhaps (lambda (n)
  15. (+ n 1)) v)))
  16. (test #f (let ((v #f))
  17. (perhaps (lambda (n)
  18. (+ n 1)) v))))
  19. (test 'apple-orange (compose-symbols 'apple 'orange))))