summaryrefslogtreecommitdiff
path: root/test-suite/standalone/test-use-srfi.in
blob: ab9d5cd5ef3a9d9928c2c7985c031d7f0bef8e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh

# Copyright (C) 2006 Free Software Foundation, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA


# Test that two srfi numbers on the command line work.
#
guile -q --use-srfi=1,10 >/dev/null <<EOF
(if (and (defined? 'partition)
         (defined? 'define-reader-ctor))
    (exit 0)   ;; good
    (exit 1))  ;; bad
EOF
if test $? = 0; then :; else
  echo "guile --use-srfi=1,10 fails to run"
  exit 1
fi


# Test that running "guile --use-srfi=1" leaves the interactive REPL with
# the srfi-1 version of iota.
#
# In guile 1.8.1 and earlier, and 1.6.8 and earlier, these failed because in
# `top-repl' the core bindings got ahead of anything --use-srfi gave.
#

guile -q --use-srfi=1 >/dev/null <<EOF
(catch #t
  (lambda ()
    (iota 2 3 4))
  (lambda args
    (exit 1))) ;; bad
(exit 0)       ;; good
EOF
if test $? = 0; then :; else
  echo "guile --use-srfi=1 doesn't give SRFI-1 iota"
  exit 1
fi


# Similar test on srfi-17 car, which differs in being a #:replacement.  This
# exercises duplicates handling in `top-repl' versus `use-srfis' (in
# boot-9.scm).
#
guile -q --use-srfi=17 >/dev/null <<EOF
(if (procedure-with-setter? car)
    (exit 0)   ;; good
    (exit 1))  ;; bad
EOF
if test $? = 0; then :; else
  echo "guile --use-srfi=17 doesn't give SRFI-17 car"
  exit 1
fi