test-use-srfi.in 2.1 KB

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