test-use-srfi.in 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/sh
  2. # Copyright (C) 2006 Free Software Foundation, Inc.
  3. #
  4. # This library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Lesser General Public License
  6. # as published by the Free Software Foundation; either version 3 of
  7. # the License, or (at your option) any later version.
  8. #
  9. # This library is distributed in the hope that it will be useful, but
  10. # WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. # Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public
  15. # License along with this library; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  17. # 02110-1301 USA
  18. # Test that two srfi numbers on the command line work.
  19. #
  20. guile -q --use-srfi=1,10 >/dev/null <<EOF
  21. (if (and (defined? 'partition)
  22. (defined? 'define-reader-ctor))
  23. (exit 0) ;; good
  24. (exit 1)) ;; bad
  25. EOF
  26. if test $? = 0; then :; else
  27. echo "guile --use-srfi=1,10 fails to run"
  28. exit 1
  29. fi
  30. # Test that running "guile --use-srfi=1" leaves the interactive REPL with
  31. # the srfi-1 version of iota.
  32. #
  33. # In guile 1.8.1 and earlier, and 1.6.8 and earlier, these failed because in
  34. # `top-repl' the core bindings got ahead of anything --use-srfi gave.
  35. #
  36. guile -q --use-srfi=1 >/dev/null <<EOF
  37. (catch #t
  38. (lambda ()
  39. (iota 2 3 4))
  40. (lambda args
  41. (exit 1))) ;; bad
  42. (exit 0) ;; good
  43. EOF
  44. if test $? = 0; then :; else
  45. echo "guile --use-srfi=1 doesn't give SRFI-1 iota"
  46. exit 1
  47. fi
  48. # Similar test on srfi-17 car, which differs in being a #:replacement. This
  49. # exercises duplicates handling in `top-repl' versus `use-srfis' (in
  50. # boot-9.scm).
  51. #
  52. guile -q --use-srfi=17 >/dev/null <<EOF
  53. (if (procedure-with-setter? car)
  54. (exit 0) ;; good
  55. (exit 1)) ;; bad
  56. EOF
  57. if test $? = 0; then :; else
  58. echo "guile --use-srfi=17 doesn't give SRFI-17 car"
  59. exit 1
  60. fi