srfi-88.test 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ;;;; srfi-88.test --- SRFI-88. -*- mode: scheme; coding: utf-8; -*-
  2. ;;;; Ludovic Courtès <ludo@gnu.org>
  3. ;;;;
  4. ;;;; Copyright (C) 2008, 2010 Free Software Foundation, Inc.
  5. ;;;;
  6. ;;;; This library is free software; you can redistribute it and/or
  7. ;;;; modify it under the terms of the GNU Lesser General Public
  8. ;;;; License as published by the Free Software Foundation; either
  9. ;;;; version 3 of the License, or (at your option) any later version.
  10. ;;;;
  11. ;;;; This library 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 GNU
  14. ;;;; Lesser General Public License for more details.
  15. ;;;;
  16. ;;;; You should have received a copy of the GNU Lesser General Public
  17. ;;;; License along with this library; if not, write to the Free Software
  18. ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. (define-module (test-srfi-88)
  20. :use-module (test-suite lib)
  21. :use-module (srfi srfi-88))
  22. ;; Most of the test cases are taken from SRFI-88.
  23. (with-test-prefix "srfi-88"
  24. (pass-if "cond-expand"
  25. (cond-expand (srfi-88 #t)
  26. (else #f)))
  27. (pass-if "keyword?"
  28. (and (keyword? 'foo:)
  29. (keyword? foo:)
  30. (not (keyword? 'foo))
  31. (not (keyword? ':))
  32. (keyword? (car '(a: b:)))
  33. (not (keyword? "bar"))))
  34. (pass-if "keyword->string"
  35. (and (string=? (keyword->string foo:) "foo")
  36. (string=? "a b c"
  37. (keyword->string (string->keyword "a b c")))))
  38. (pass-if "string->keyword"
  39. (eq? (string->keyword "foo") foo:))
  40. (pass-if "empty keyword"
  41. ;; XXX: We don't currently support syntax of the form
  42. ;; `#{extended symbol}#:'.
  43. (string=? ""
  44. (keyword->string (string->keyword "")))))