merge from 1.8 branch
[bpt/guile.git] / test-suite / tests / chars.test
CommitLineData
55b44a9e
GB
1;;;; chars.test --- test suite for Guile's char functions -*- scheme -*-
2;;;; Greg J. Badros <gjb@cs.washington.edu>
3;;;;
6e7d5622 4;;;; Copyright (C) 2000, 2006 Free Software Foundation, Inc.
55b44a9e
GB
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
92205699
MV
18;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19;;;; Boston, MA 02110-1301 USA
55b44a9e
GB
20
21
22(use-modules (test-suite lib))
23
47dbd81e
DH
24(define exception:wrong-type-to-apply
25 (cons 'misc-error "^Wrong type to apply:"))
26
27
28(with-test-prefix "basic char handling"
29
30 (with-test-prefix "evaluator"
31
f5c6ec2f 32 ;; The following test makes sure that the evaluator distinguishes between
47dbd81e
DH
33 ;; evaluator-internal instruction codes and characters.
34 (pass-if-exception "evaluating chars"
35 exception:wrong-type-to-apply
36 (eval '(#\0) (interaction-environment)))))
37
55b44a9e
GB
38(pass-if "char-is-both? works"
39 (and
40 (not (char-is-both? #\?))
41 (not (char-is-both? #\newline))
42 (char-is-both? #\a)
43 (char-is-both? #\Z)
44 (not (char-is-both? #\1))))
45