srfi-88.test 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ;;;; srfi-88.test --- Test suite for SRFI-88 -*- Scheme -*-
  2. ;;;; Ludovic Courtès <ludo@gnu.org>
  3. ;;;;
  4. ;;;; Copyright (C) 2008 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-srfi-88)
  21. :use-module (test-suite lib)
  22. :use-module (srfi srfi-88))
  23. ;; Most of the test cases are taken from SRFI-88.
  24. (with-test-prefix "srfi-88"
  25. (pass-if "cond-expand"
  26. (cond-expand (srfi-88 #t)
  27. (else #f)))
  28. (pass-if "keyword?"
  29. (and (keyword? 'foo:)
  30. (keyword? foo:)
  31. (not (keyword? 'foo))
  32. (not (keyword? ':))
  33. (keyword? (car '(a: b:)))
  34. (not (keyword? "bar"))))
  35. (pass-if "keyword->string"
  36. (and (string=? (keyword->string foo:) "foo")
  37. (string=? "a b c"
  38. (keyword->string (string->keyword "a b c")))))
  39. (pass-if "string->keyword"
  40. (eq? (string->keyword "foo") foo:))
  41. (pass-if "empty keyword"
  42. ;; XXX: We don't currently support syntax of the form
  43. ;; `#{extended symbol}#:'.
  44. (string=? ""
  45. (keyword->string (string->keyword "")))))
  46. ;;; Local Variables:
  47. ;;; coding: latin-1
  48. ;;; End: