]> git.donarmstrong.com Git - lilypond.git/blob - guile18/test-suite/tests/srfi-88.test
New upstream version 2.19.65
[lilypond.git] / guile18 / test-suite / tests / srfi-88.test
1 ;;;; srfi-88.test --- Test suite for SRFI-88               -*- Scheme -*-
2 ;;;; Ludovic Courtès <ludo@gnu.org>
3 ;;;;
4 ;;;;    Copyright (C) 2008 Free Software Foundation, Inc.
5 ;;;;
6 ;;;; This program is free software; you can redistribute it and/or modify
7 ;;;; it under the terms of the GNU General Public License as published by
8 ;;;; the Free Software Foundation; either version 2, or (at your option)
9 ;;;; any later version.
10 ;;;;
11 ;;;; This program 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
14 ;;;; GNU General Public License for more details.
15 ;;;;
16 ;;;; You should have received a copy of the GNU General Public License
17 ;;;; along with this software; see the file COPYING.  If not, write to
18 ;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 ;;;; Boston, MA 02110-1301 USA
20
21 (define-module (test-srfi-88)
22   :use-module (test-suite lib)
23   :use-module (srfi srfi-88))
24
25 \f
26 ;; Most of the test cases are taken from SRFI-88.
27
28 (with-test-prefix "srfi-88"
29
30   (pass-if "cond-expand"
31     (cond-expand (srfi-88 #t)
32                  (else    #f)))
33
34   (pass-if "keyword?"
35     (and (keyword? 'foo:)
36          (keyword? foo:)
37          (not (keyword? 'foo))
38          (not (keyword? ':))
39          (keyword? (car '(a: b:)))
40          (not (keyword? "bar"))))
41
42   (pass-if "keyword->string"
43     (and (string=? (keyword->string foo:) "foo")
44          (string=? "a b c"
45                    (keyword->string (string->keyword "a b c")))))
46
47   (pass-if "string->keyword"
48     (eq? (string->keyword "foo") foo:))
49
50   (pass-if "empty keyword"
51     ;; XXX: We don't currently support syntax of the form
52     ;; `#{extended symbol}#:'.
53     (string=? ""
54               (keyword->string (string->keyword "")))))
55
56
57 ;;; Local Variables:
58 ;;; coding: latin-1
59 ;;; End: