Fast generic function dispatch without calling `compile' at runtime
[bpt/guile.git] / test-suite / tests / encoding-iso88591.test
CommitLineData
a5229ee8 1;;;; encoding-iso88591.test --- test suite for Guile's string encodings -*- mode: scheme; coding: iso-8859-1 -*-
889975e5 2;;;;
0ce22459 3;;;; Copyright (C) 2009, 2010, 2014 Free Software Foundation, Inc.
a5229ee8
LC
4;;;;
5;;;; This library is free software; you can redistribute it and/or
6;;;; modify it under the terms of the GNU Lesser General Public
7;;;; License as published by the Free Software Foundation; either
8;;;; version 3 of the License, or (at your option) any later version.
9;;;;
10;;;; This library is distributed in the hope that it will be useful,
889975e5 11;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a5229ee8
LC
12;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13;;;; Lesser General Public License for more details.
14;;;;
15;;;; You should have received a copy of the GNU Lesser General Public
16;;;; License along with this library; if not, write to the Free Software
17;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
889975e5
MG
18
19(define-module (test-strings)
20 #:use-module (test-suite lib)
21 #:use-module (srfi srfi-1))
22
889975e5
MG
23;; Create a string from integer char values, eg. (string-ints 65) => "A"
24(define (string-ints . args)
25 (apply string (map integer->char args)))
26
ce3ed012 27;; Set locale to the environment's locale, so that the prints look OK.
0ce22459
MW
28(when (defined? 'setlocale)
29 (setlocale LC_ALL ""))
889975e5 30
bda0d85f
MG
31(define ascii-a (integer->char 65)) ; LATIN CAPITAL LETTER A
32(define a-acute (integer->char #x00c1)) ; LATIN CAPITAL LETTER A WITH ACUTE
33(define alpha (integer->char #x03b1)) ; GREEK SMALL LETTER ALPHA
34(define cherokee-a (integer->char #x13a0)) ; CHEROKEE LETTER A
35
36(with-test-prefix "characters"
37 (pass-if "input A"
38 (char=? ascii-a #\A))
39
40 (pass-if "input A acute"
41