test-arity.ss 532 B

123456789101112131415161718192021222324252627282930313233
  1. (import (mit arity)
  2. (srfi :64))
  3. ;; test procedures
  4. (define fbe-p1 (lambda (x) x))
  5. (define fbe-p2 (lambda x x))
  6. (define fbe-p3
  7. (case-lambda
  8. ((x) x)
  9. ((x y) (cons x y))))
  10. (define fbe-p4
  11. (case-lambda
  12. ((x) x)
  13. ((x . y) (cons x y))))
  14. ;; start tests
  15. (test-begin "procedure-arity")
  16. (test-equal '(1 . 1) (procedure-arity fbe-p1))
  17. (test-equal '(0 . #f) (procedure-arity fbe-p2))
  18. (test-equal '(1 . 2) (procedure-arity fbe-p3))
  19. (test-equal '(1 . #f) (procedure-arity fbe-p4))
  20. (test-end "procedure-arity")