srfi-9.test 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #! /bin/sh
  2. # -*-scheme-*-
  3. exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-9)' -s "$0" "$@"
  4. !#
  5. ;;; -*-scheme-*-
  6. ;;; GNU Mes --- Maxwell Equations of Software
  7. ;;; Copyright © 2016,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  8. ;;;
  9. ;;; This file is part of GNU Mes.
  10. ;;;
  11. ;;; GNU Mes is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Mes is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (tests srfi-9)
  24. #:use-module (srfi srfi-9)
  25. #:use-module (srfi srfi-9 gnu)
  26. #:use-module (mes mes-0)
  27. #:use-module (mes test))
  28. (cond-expand
  29. (mes
  30. (mes-use-module (srfi srfi-9))
  31. (mes-use-module (srfi srfi-9 gnu))
  32. (mes-use-module (mes test)))
  33. (else))
  34. (pass-if "first dummy" #t)
  35. (pass-if-not "second dummy" #f)
  36. (define-record-type lexical-token
  37. (make-lexical-token category source value)
  38. lexical-token?
  39. (category lexical-token-category)
  40. (source lexical-token-source)
  41. (value lexical-token-value))
  42. (pass-if "record"
  43. (lexical-token? (make-lexical-token 'x 'y 'z)))
  44. (pass-if-equal "set-field" "baar"
  45. (let ((token (make-lexical-token 'foo "bar" 'baz)))
  46. (lexical-token-category (set-field token (lexical-token-category) "baar"))))
  47. (result 'report)