]> git.donarmstrong.com Git - lilypond.git/blob - guile18/test-suite/tests/multilingual.nottest
New upstream version 2.19.65
[lilypond.git] / guile18 / test-suite / tests / multilingual.nottest
1 ;;;; multilingual.nottest --- tests of multilingual support    -*- scheme -*-
2 ;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
3 ;;;; This isn't a test yet, because we don't have multilingual support yet.
4 ;;;;
5 ;;;;    Copyright (C) 1999, 2006 Free Software Foundation, Inc.
6 ;;;; 
7 ;;;; This program is free software; you can redistribute it and/or modify
8 ;;;; it under the terms of the GNU General Public License as published by
9 ;;;; the Free Software Foundation; either version 2, or (at your option)
10 ;;;; any later version.
11 ;;;; 
12 ;;;; This program is distributed in the hope that it will be useful,
13 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ;;;; GNU General Public License for more details.
16 ;;;; 
17 ;;;; You should have received a copy of the GNU General Public License
18 ;;;; along with this software; see the file COPYING.  If not, write to
19 ;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ;;;; Boston, MA 02110-1301 USA
21
22 (use-modules (test-suite lib))
23
24 \f
25 ;;; Tests of Emacs 20.4 character encoding.
26
27 ;;; Check that characters are being encoded correctly.
28
29 ;;; These tests are specific to the Emacs 20.4 encoding; they'll need
30 ;;; to be replaced when Guile switches to UTF-8.  See mb.c for a
31 ;;; description of this encoding.
32
33 (define (check-encoding char-number encoding)
34   (let ((singleton (string (integer->char char-number))))
35     (pass-if (string-append "encoding character "
36                             (number->string char-number))
37              (equal? (string->bytes singleton) encoding))
38     (pass-if (string-append "decoding character "
39                             (number->string char-number))
40              (catch #t
41                     (lambda ()
42                       (equal? (bytes->string encoding) singleton))
43                     (lambda dummy #f)))))
44                       
45
46 ;; Check some ASCII characters.
47 (check-encoding 0 #y(0))
48 (check-encoding 127 #y(127))
49 (check-encoding 31 #y(31))
50 (check-encoding 32 #y(32))
51 (check-encoding 42 #y(42))
52
53 ;;; Sometimes we mark something as an "end of range", when it's not
54 ;;; actually the last character that would use that encoding form.
55 ;;; This is because not all character set numbers are assigned, and we
56 ;;; can't use unassigned character set numbers.  So the value given is
57 ;;; the last value which actually corresponds to something in a real
58 ;;; character set.
59
60 ;; Check some characters encoded in two bytes.
61 (check-encoding 2208 #y(#x81 #xA0)) ; beginning of range
62 (check-encoding 3839 #y(#x8d #xFF)) ; end of range
63 (check-encoding 2273 #y(#x81 #xE1))
64
65 ;; Check some big characters encoded in three bytes.
66 (check-encoding 20512  #y(#x90 #xA0 #xA0)) ; beginning of range
67 (check-encoding 180223 #y(#x99 #xFF #xFF)) ; end of range
68 (check-encoding 53931  #y(#x92 #xA5 #xAB))
69
70 ;; Check some small characters encoded in three bytes --- some from
71 ;; the #x9A prefix range, and some from the #x9B prefix range.
72 (check-encoding 6176   #y(#x9A #xA0 #xA0))  ; start of the #9A prefix range
73 (check-encoding 7167   #y(#x9A #xA7 #xFF))  ; end   of the #9A prefix range
74 (check-encoding 14368  #y(#x9B #xE0 #xA0))  ; start of the #9B prefix range
75 (check-encoding 14591  #y(#x9B #xE1 #xFF))  ; end   of the #9B prefix range
76
77 ;; Check some characters encoded in four bytes.
78 (check-encoding 266272 #y(#x9C #xF0 #xA0 #xA0)) ; start of the #9C prefix range
79 (check-encoding 294911 #y(#x9C #xF1 #xFF #xFF)) ; end   of the #9C prefix range
80 (check-encoding 348192 #y(#x9D #xF5 #xA0 #xA0)) ; start of the #9D prefix range
81 (check-encoding 475135 #y(#x9D #xFC #xFF #xFF)) ; start of the #9D prefix range