procprop.test 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ;;;; procprop.test --- Procedure properties -*- Scheme -*-
  2. ;;;; Ludovic Courtès <ludo@gnu.org>
  3. ;;;;
  4. ;;;; Copyright (C) 2009 Free Software Foundation, Inc.
  5. ;;;;
  6. ;;;; This program is free software; you can redistribute it and/or modify
  7. ;;;; it under the terms of the GNU General Public License as published by
  8. ;;;; the Free Software Foundation; either version 2, or (at your option)
  9. ;;;; any later version.
  10. ;;;;
  11. ;;;; This program is distributed in the hope that it will be useful,
  12. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;;; GNU General Public License for more details.
  15. ;;;;
  16. ;;;; You should have received a copy of the GNU General Public License
  17. ;;;; along with this software; see the file COPYING. If not, write to
  18. ;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19. ;;;; Boston, MA 02110-1301 USA
  20. (define-module (test-procpop)
  21. :use-module (test-suite lib))
  22. (with-test-prefix "procedure-name"
  23. (pass-if "simple subr"
  24. (eq? 'display (procedure-name display)))
  25. (pass-if "gsubr"
  26. (eq? 'hashq-ref (procedure-name hashq-ref))))
  27. (with-test-prefix "procedure-arity"
  28. (pass-if "simple subr"
  29. (equal? (procedure-property display 'arity)
  30. '(1 1 #f)))
  31. (pass-if "gsubr"
  32. (equal? (procedure-property hashq-ref 'arity)
  33. '(2 1 #f)))
  34. (pass-if "port-closed?"
  35. (equal? (procedure-property port-closed? 'arity)
  36. '(1 0 #f)))
  37. (pass-if "apply"
  38. (equal? (procedure-property apply 'arity)
  39. '(1 0 #t)))
  40. (pass-if "cons*"
  41. (equal? (procedure-property cons* 'arity)
  42. '(1 0 #t)))
  43. (pass-if "list"
  44. (equal? (procedure-property list 'arity)
  45. '(0 0 #t))))
  46. ;;; Local Variables:
  47. ;;; coding: latin-1
  48. ;;; End: