annotate tests/automated/mule-tests.el @ 4318:4d0f773d5e21

Fix the test failures introduced by the non-ISO-2022 coding systems. APPROVE COMMIT NOTE: this patch has been committed. This is patch http://mid.gmane.org/18264.25814.828088.486899@parhasard.net tests/ChangeLog addition: 2007-12-06 Aidan Kehoe <kehoea@parhasard.net> * automated/mule-tests.el: Add a Known-Bug-Expect-Error call testing and documenting that we don't support all of the Unicode code space in a single session. * automated/test-harness.el (Known-Bug-Expect-Error): Provide Known-Bug-Expect-Error, analagous to Known-Bug-Expect-Failure and Check-Error. * automated/test-harness.el (Silence-Message): Dynamically bind the function definition of #'clear-message, as well as that of #'append-message, to nil. src/ChangeLog addition: 2007-12-06 Aidan Kehoe <kehoea@parhasard.net> * tests.c (Ftest_data_format_conversion): Move those tests that expect that iso-8859-2 is ISO 2022-compatible to testing iso-latin-2-with-esc instead.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Dec 2007 15:10:46 +0100
parents 2bb3630ea397
children e5b3c4dbc8a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;; Copyright (C) 1999 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Author: Hrvoje Niksic <hniksic@xemacs.org>
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
4 ;; Maintainers: Hrvoje Niksic <hniksic@xemacs.org>,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
5 ;; Martin Buchholz <martin@xemacs.org>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 ;; Created: 1999
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Keywords: tests
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 ;;; Synched up with: Not in FSF.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 ;; Test some Mule functionality (most of these remain to be written) .
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;; See test-harness.el for instructions on how to run these tests.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
33 ;; This file will be (read)ed by a non-mule XEmacs, so don't use
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
34 ;; literal non-Latin1 characters. Use (make-char) instead.
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
35
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
36 (require 'bytecomp)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
37
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ;;-----------------------------------------------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 ;; Test whether all legal chars may be safely inserted to a buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 ;;-----------------------------------------------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 (defun test-chars (&optional for-test-harness)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 "Insert all characters in a buffer, to see if XEmacs will crash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 This is done by creating a string with all the legal characters
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
45 in [0, 2^21) range, inserting it into the buffer, and checking
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 that the buffer's contents are equivalent to the string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 If FOR-TEST-HARNESS is specified, a temporary buffer is used, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 the Assert macro checks for correctness."
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
50 (let ((max (expt 2 (if (featurep 'mule) 21 8)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 (list nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 (i 0))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 (while (< i max)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 (and (not for-test-harness)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 (zerop (% i 1000))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 (message "%d" i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 (and (int-char i)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ;; Don't aset to a string directly because random string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 ;; access is O(n) under Mule.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 (setq list (cons (int-char i) list)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 (setq i (1+ i)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 (let ((string (apply #'string (nreverse list))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (if for-test-harness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 ;; For use with test-harness, use Assert and a temporary
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 ;; buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 (with-temp-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 (insert string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 (Assert (equal (buffer-string) string)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 ;; For use without test harness: use a normal buffer, so that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 ;; you can also test whether redisplay works.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 (switch-to-buffer (get-buffer-create "test"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 (erase-buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 (buffer-disable-undo)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 (insert string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 (assert (equal (buffer-string) string))))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 ;; It would be really *really* nice if test-harness allowed a way to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 ;; run a test in byte-compiled mode only. It's tedious to have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 ;; time-consuming tests like this one run twice, once interpreted and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 ;; once compiled, for no good reason.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 (test-chars t)
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
82
3439
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
83 (defun unicode-code-point-to-utf-8-string (code-point)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
84 "Convert a Unicode code point to the equivalent UTF-8 string.
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
85 This is a naive implementation in Lisp. "
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
86 (check-argument-type 'natnump code-point)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
87 (check-argument-range code-point 0 #x1fffff)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
88 (if (< code-point #x80)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
89 (format "%c" code-point)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
90 (if (< code-point #x800)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
91 (format "%c%c"
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
92 ;; ochars[0] = 0xC0 | (input & ~(0xFFFFF83F)) >> 6;
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
93 (logior #xc0 (lsh (logand code-point #x7c0) -6))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
94 ;; ochars[1] = 0x80 | input & ~(0xFFFFFFC0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
95 (logior #x80 (logand code-point #x3f)))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
96 (if (< code-point #x00010000)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
97 (format "%c%c%c"
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
98 ;; ochars[0] = 0xE0 | (input >> 12) & ~(0xFFFFFFF0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
99 (logior #xe0 (logand (lsh code-point -12) #x0f))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
100 ;; ochars[1] = 0x80 | (input >> 6) & ~(0xFFFFFFC0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
101 (logior #x80 (logand (lsh code-point -6) #x3f))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
102 ;; ochars[2] = 0x80 | input & ~(0xFFFFFFC0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
103 (logior #x80 (logand code-point #x3f)))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
104 (if (< code-point #x200000)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
105 (format "%c%c%c%c"
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
106 ;; ochars[0] = 0xF0 | (input >> 18) & ~(0xFFFFFFF8)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
107 (logior #xF0 (logand (lsh code-point -18) #x7))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
108 ;; ochars[1] = 0x80 | (input >> 12) & ~(0xFFFFFFC0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
109 (logior #x80 (logand (lsh code-point -12) #x3f))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
110 ;; ochars[2] = 0x80 | (input >> 6) & ~(0xFFFFFFC0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
111 (logior #x80 (logand (lsh code-point -6) #x3f))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
112 ;; ochars[3] = 0x80 | input & ~(0xFFFFFFC0);
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
113 (logior #x80 (logand code-point #x3f))))))))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
114
4026
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
115 ;;----------------------------------------------------------------
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
116 ;; Test that revert-buffer resets the modiff
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
117 ;; Bug reported 2007-06-20 <200706201902.32191.scop@xemacs.org>.
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
118 ;; Fixed 2007-06-22 <18043.2793.611745.734215@parhasard.net>.
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
119 ;;----------------------------------------------------------------
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
120
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
121 (let ((test-file-name
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
122 ;; The Gnus people, when they call #'make-temp-name, then loop,
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
123 ;; checking if the corresponding file exists. Our #'make-temp-name
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
124 ;; already does this loop, and the Gnus approach doesn't bring
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
125 ;; anything; there remains a race condition if you can predict the
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
126 ;; path name. The path name in question depends on the process ID and
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
127 ;; a (weak) PRNG seeded with the seconds to the power of the
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
128 ;; milliseconds of some instant close to the startup time of this
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
129 ;; XEmacs; without being able to read the address space of this
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
130 ;; XEmacs, or monitor what stat() calls it does, it is not predictable.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
131 ;;
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
132 ;; The really kosher way to do this is to merge GNU's make-temp-file
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
133 ;; and use that. It basically has the functionality of the Unix
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
134 ;; mkstemp.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
135 (make-temp-name (expand-file-name "tXfXsKc" (temp-directory))))
4026
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
136 revert-buffer-function
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
137 kill-buffer-hook) ; paranoia
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
138 (find-file test-file-name)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
139 (erase-buffer)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
140 (insert "a string\n")
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
141 (Silence-Message (save-buffer 0))
4026
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
142 (insert "more text\n")
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
143 (revert-buffer t t)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
144 ;; Just "find-file" with autodetect coding didn't fail for me, but it does
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
145 ;; fail under test harness. Still we'll redo the test with an explicit
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
146 ;; coding system just in case.
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
147 (Assert (not (buffer-modified-p)))
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
148 (kill-buffer nil)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
149 (when (find-coding-system 'utf-8)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
150 (find-file test-file-name 'utf-8)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
151 (insert "more text\n")
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
152 (revert-buffer t t)
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
153 (Assert (not (buffer-modified-p)))
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
154 (kill-buffer nil))
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
155 (delete-file test-file-name))
4d60c2708e5d [xemacs-hg @ 2007-06-22 16:37:37 by stephent]
stephent
parents: 3976
diff changeset
156
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
157 ;;-----------------------------------------------------------------
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
158 ;; Test string modification functions that modify the length of a char.
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
159 ;;-----------------------------------------------------------------
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
160
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
161 (when (featurep 'mule)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
162 ;;---------------------------------------------------------------
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
163 ;; Test fillarray
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
164 ;;---------------------------------------------------------------
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
165 (macrolet
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
166 ((fillarray-test
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
167 (charset1 charset2)
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
168 (let ((char1 (make-char charset1 69))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
169 (char2 (make-char charset2 69)))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
170 `(let ((string (make-string 1000 ,char1)))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
171 (fillarray string ,char2)
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
172 (Assert (eq (aref string 0) ,char2))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
173 (Assert (eq (aref string (1- (length string))) ,char2))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
174 (Assert (eq (length string) 1000))))))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
175 (fillarray-test ascii latin-iso8859-1)
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
176 (fillarray-test ascii latin-iso8859-2)
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
177 (fillarray-test latin-iso8859-1 ascii)
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
178 (fillarray-test latin-iso8859-2 ascii))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
179
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
180 ;; Test aset
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
181 (let ((string (string (make-char 'ascii 69) (make-char 'latin-iso8859-2 69))))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
182 (aset string 0 (make-char 'latin-iso8859-2 42))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
183 (Assert (eq (aref string 1) (make-char 'latin-iso8859-2 69))))
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
184
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
185 ;;---------------------------------------------------------------
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
186 ;; Test coding system functions
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
187 ;;---------------------------------------------------------------
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
188
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
189 ;; Create alias for coding system without subsidiaries
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
190 (Assert (coding-system-p (find-coding-system 'binary)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
191 (Assert (coding-system-canonical-name-p 'binary))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
192 (Assert (not (coding-system-alias-p 'binary)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
193 (Assert (not (coding-system-alias-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
194 (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
195 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
196 error "Symbol is the canonical name of a coding system and cannot be redefined"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
197 (define-coding-system-alias 'binary 'iso8859-2))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
198 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
199 error "Symbol is not a coding system alias"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
200 (coding-system-aliasee 'binary))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
201
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
202 (define-coding-system-alias 'mule-tests-alias 'binary)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
203 (Assert (coding-system-alias-p 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
204 (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
205 (Assert (eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
206 (Assert (eq 'binary (coding-system-aliasee 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
207 (Assert (not (coding-system-alias-p 'mule-tests-alias-unix)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
208 (Assert (not (coding-system-alias-p 'mule-tests-alias-dos)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
209 (Assert (not (coding-system-alias-p 'mule-tests-alias-mac)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
210
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
211 (define-coding-system-alias 'mule-tests-alias (get-coding-system 'binary))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
212 (Assert (coding-system-alias-p 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
213 (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
214 (Assert (eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
215 (Assert (eq 'binary (coding-system-aliasee 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
216 (Assert (not (coding-system-alias-p 'mule-tests-alias-unix)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
217 (Assert (not (coding-system-alias-p 'mule-tests-alias-dos)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
218 (Assert (not (coding-system-alias-p 'mule-tests-alias-mac)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
219
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
220 (define-coding-system-alias 'nested-mule-tests-alias 'mule-tests-alias)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
221 (Assert (coding-system-alias-p 'nested-mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
222 (Assert (not (coding-system-canonical-name-p 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
223 (Assert (eq (get-coding-system 'binary) (get-coding-system 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
224 (Assert (eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
225 (Assert (eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
226 (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-unix)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
227 (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-dos)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
228 (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-mac)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
229
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
230 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
231 error "Attempt to create a coding system alias loop"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
232 (define-coding-system-alias 'mule-tests-alias 'nested-mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
233 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
234 error "No such coding system"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
235 (define-coding-system-alias 'no-such-coding-system 'no-such-coding-system))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
236 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
237 error "Attempt to create a coding system alias loop"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
238 (define-coding-system-alias 'mule-tests-alias 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
239
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
240 (define-coding-system-alias 'nested-mule-tests-alias nil)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
241 (define-coding-system-alias 'mule-tests-alias nil)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
242 (Assert (coding-system-p (find-coding-system 'binary)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
243 (Assert (coding-system-canonical-name-p 'binary))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
244 (Assert (not (coding-system-alias-p 'binary)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
245 (Assert (not (coding-system-alias-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
246 (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
247 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
248 error "Symbol is the canonical name of a coding system and cannot be redefined"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
249 (define-coding-system-alias 'binary 'iso8859-2))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
250 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
251 error "Symbol is not a coding system alias"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
252 (coding-system-aliasee 'binary))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
253
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
254 (define-coding-system-alias 'nested-mule-tests-alias nil)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
255 (define-coding-system-alias 'mule-tests-alias nil)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
256
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
257 ;; Create alias for coding system with subsidiaries
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
258 (define-coding-system-alias 'mule-tests-alias 'iso-8859-7)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
259 (Assert (coding-system-alias-p 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
260 (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
261 (Assert (eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
262 (Assert (eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
263 (Assert (coding-system-alias-p 'mule-tests-alias-unix))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
264 (Assert (coding-system-alias-p 'mule-tests-alias-dos))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
265 (Assert (coding-system-alias-p 'mule-tests-alias-mac))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
266
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
267 (define-coding-system-alias 'mule-tests-alias (get-coding-system 'iso-8859-7))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
268 (Assert (coding-system-alias-p 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
269 (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
270 (Assert (eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
271 (Assert (eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
272 (Assert (coding-system-alias-p 'mule-tests-alias-unix))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
273 (Assert (coding-system-alias-p 'mule-tests-alias-dos))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
274 (Assert (coding-system-alias-p 'mule-tests-alias-mac))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
275 (Assert (eq (find-coding-system 'mule-tests-alias-mac)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
276 (find-coding-system 'iso-8859-7-mac)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
277
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
278 (define-coding-system-alias 'nested-mule-tests-alias 'mule-tests-alias)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
279 (Assert (coding-system-alias-p 'nested-mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
280 (Assert (not (coding-system-canonical-name-p 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
281 (Assert (eq (get-coding-system 'iso-8859-7)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
282 (get-coding-system 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
283 (Assert (eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
284 (Assert (eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
285 (Assert (coding-system-alias-p 'nested-mule-tests-alias-unix))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
286 (Assert (coding-system-alias-p 'nested-mule-tests-alias-dos))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
287 (Assert (coding-system-alias-p 'nested-mule-tests-alias-mac))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
288 (Assert (eq (find-coding-system 'nested-mule-tests-alias-unix)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
289 (find-coding-system 'iso-8859-7-unix)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
290
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
291 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
292 error "Attempt to create a coding system alias loop"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
293 (define-coding-system-alias 'mule-tests-alias 'nested-mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
294 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
295 error "No such coding system"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
296 (define-coding-system-alias 'no-such-coding-system 'no-such-coding-system))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
297 (Check-Error-Message
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
298 error "Attempt to create a coding system alias loop"
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
299 (define-coding-system-alias 'mule-tests-alias 'mule-tests-alias))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
300
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
301 ;; Test dangling alias deletion
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
302 (define-coding-system-alias 'mule-tests-alias nil)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
303 (Assert (not (coding-system-alias-p 'mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
304 (Assert (not (coding-system-alias-p 'mule-tests-alias-unix)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
305 (Assert (not (coding-system-alias-p 'nested-mule-tests-alias)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
306 (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-dos)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
307
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
308 ;;---------------------------------------------------------------
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
309 ;; Test strings waxing and waning across the 8k BIG_STRING limit (see alloc.c)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
310 ;;---------------------------------------------------------------
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
311 (defun charset-char-string (charset)
2026
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
312 (let (lo hi string n (gc-cons-threshold most-positive-fixnum))
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
313 (if (= (charset-chars charset) 94)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
314 (setq lo 33 hi 126)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
315 (setq lo 32 hi 127))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
316 (if (= (charset-dimension charset) 1)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
317 (progn
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
318 (setq string (make-string (1+ (- hi lo)) ??))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
319 (setq n 0)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
320 (loop for j from lo to hi do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
321 (progn
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
322 (aset string n (make-char charset j))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
323 (incf n)))
2026
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
324 (garbage-collect)
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
325 string)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
326 (progn
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
327 (setq string (make-string (* (1+ (- hi lo)) (1+ (- hi lo))) ??))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
328 (setq n 0)
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
329 (loop for j from lo to hi do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
330 (loop for k from lo to hi do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
331 (progn
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
332 (aset string n (make-char charset j k))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
333 (incf n))))
2026
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
334 (garbage-collect)
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
335 string))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
336
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
337 ;; The following two used to crash xemacs!
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
338 (Assert (charset-char-string 'japanese-jisx0208))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
339 (aset (make-string 9003 ??) 1 (make-char 'latin-iso8859-1 77))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
340
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
341 (let ((greek-string (charset-char-string 'greek-iso8859-7))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
342 (string (make-string (* 96 60) ??)))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
343 (loop for j from 0 below (length string) do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
344 (aset string j (aref greek-string (mod j 96))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
345 (loop for k in '(0 1 58 59) do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
346 (Assert (equal (substring string (* 96 k) (* 96 (1+ k))) greek-string))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
347
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
348 (let ((greek-string (charset-char-string 'greek-iso8859-7))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
349 (string (make-string (* 96 60) ??)))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
350 (loop for j from (1- (length string)) downto 0 do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
351 (aset string j (aref greek-string (mod j 96))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
352 (loop for k in '(0 1 58 59) do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
353 (Assert (equal (substring string (* 96 k) (* 96 (1+ k))) greek-string))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
354
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
355 (let ((ascii-string (charset-char-string 'ascii))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
356 (string (make-string (* 94 60) (make-char 'greek-iso8859-7 57))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
357 (loop for j from 0 below (length string) do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
358 (aset string j (aref ascii-string (mod j 94))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
359 (loop for k in '(0 1 58 59) do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
360 (Assert (equal (substring string (* 94 k) (+ 94 (* 94 k))) ascii-string))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
361
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
362 (let ((ascii-string (charset-char-string 'ascii))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
363 (string (make-string (* 94 60) (make-char 'greek-iso8859-7 57))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
364 (loop for j from (1- (length string)) downto 0 do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
365 (aset string j (aref ascii-string (mod j 94))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
366 (loop for k in '(0 1 58 59) do
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
367 (Assert (equal (substring string (* 94 k) (* 94 (1+ k))) ascii-string))))
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 434
diff changeset
368
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
369 ;;---------------------------------------------------------------
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
370 ;; Test file-system character conversion (and, en passant, file ops)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
371 ;;---------------------------------------------------------------
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
372 (let* ((dstroke (make-char 'latin-iso8859-2 80))
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
373 (latin2-string (make-string 4 dstroke))
597
ce085c4b3999 [xemacs-hg @ 2001-06-01 05:05:54 by martinb]
martinb
parents: 442
diff changeset
374 (prefix (concat (file-name-as-directory
ce085c4b3999 [xemacs-hg @ 2001-06-01 05:05:54 by martinb]
martinb
parents: 442
diff changeset
375 (file-truename (temp-directory)))
ce085c4b3999 [xemacs-hg @ 2001-06-01 05:05:54 by martinb]
martinb
parents: 442
diff changeset
376 latin2-string))
2026
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
377 (file-name-coding-system
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
378 ;; 'iso-8859-X doesn't work on darwin (as of "Panther" 10.3), it
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
379 ;; seems to know that file-name-coding-system is definitely utf-8
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
380 (if (string-match "darwin" system-configuration)
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
381 'utf-8
ca02e61c9829 [xemacs-hg @ 2004-04-19 06:22:32 by stephent]
stephent
parents: 1316
diff changeset
382 'iso-8859-2))
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
383 ;; make-temp-name does stat(), which on OS X requires that you
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
384 ;; normalise, where open() will normalise for you. Previously we
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
385 ;; used scaron as the Latin-2 character, and make-temp-name errored
3976
d76663859e32 [xemacs-hg @ 2007-05-21 08:11:37 by aidan]
aidan
parents: 3970
diff changeset
386 ;; on OS X. LATIN CAPITAL LETTER D WITH STROKE does not decompose.
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
387 (name1 (make-temp-name prefix))
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
388 (name2 (make-temp-name prefix)))
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
389 ;; This is how you suppress output from `message', called by `write-region'
3472
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
390 (Assert (not (equal name1 name2)))
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
391 (Assert (not (file-exists-p name1)))
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
392 (Silence-Message
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
393 (write-region (point-min) (point-max) name1))
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
394 (Assert (file-exists-p name1))
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
395 (when (fboundp 'make-symbolic-link)
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
396 (make-symbolic-link name1 name2)
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
397 (Assert (file-exists-p name2))
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
398 (Assert (equal (file-truename name2) name1))
43b4a54fbf66 [xemacs-hg @ 2006-06-24 14:30:36 by stephent]
stephent
parents: 3439
diff changeset
399 (Assert (equal (file-truename name1) name1)))
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
400 (ignore-file-errors (delete-file name1) (delete-file name2)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
401
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
402 ;; Add many more file operation tests here...
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
403
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
404 ;;---------------------------------------------------------------
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
405 ;; Test Unicode-related functions
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
406 ;;---------------------------------------------------------------
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
407 (let* ((scaron (make-char 'latin-iso8859-2 57)))
875
708faa3b4cb1 [xemacs-hg @ 2002-06-23 06:53:46 by stephent]
stephent
parents: 800
diff changeset
408 ;; Used to try #x0000, but you can't change ASCII or Latin-1
708faa3b4cb1 [xemacs-hg @ 2002-06-23 06:53:46 by stephent]
stephent
parents: 800
diff changeset
409 (loop for code in '(#x0100 #x2222 #x4444 #xffff) do
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
410 (progn
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 597
diff changeset
411 (set-unicode-conversion scaron code)
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 597
diff changeset
412 (Assert (eq code (char-to-unicode scaron)))
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 597
diff changeset
413 (Assert (eq scaron (unicode-to-char code '(latin-iso8859-2))))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
414
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 597
diff changeset
415 (Check-Error wrong-type-argument (set-unicode-conversion scaron -10000)))
1195
dff007bd492b [xemacs-hg @ 2003-01-09 12:49:36 by stephent]
stephent
parents: 875
diff changeset
416
3439
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
417 (dolist (utf-8-char
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
418 '("\xc6\x92" ;; U+0192 LATIN SMALL LETTER F WITH HOOK
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
419 "\xe2\x81\x8a" ;; U+204A TIRONIAN SIGN ET
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
420 "\xe2\x82\xae" ;; U+20AE TUGRIK SIGN
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
421 "\xf0\x9d\x92\xbd" ;; U+1D4BD MATHEMATICAL SCRIPT SMALL H
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
422 "\xf0\x9d\x96\x93" ;; U+1D593 MATHEMATICAL BOLD FRAKTUR SMALL N
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
423 "\xf0\xaf\xa8\x88" ;; U+2FA08 CJK COMPATIBILITY FOR U+4BCE
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
424 "\xf4\x8f\xbf\xbd")) ;; U+10FFFD <Plane 16 Private Use, Last>
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
425 (let* ((xemacs-character (car (append
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
426 (decode-coding-string utf-8-char 'utf-8)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
427 nil)))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
428 (xemacs-charset (car (split-char xemacs-character))))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
429
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
430 ;; Trivial test of the UTF-8 support of the escape-quoted character set.
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
431 (Assert (equal (decode-coding-string utf-8-char 'utf-8)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
432 (decode-coding-string (concat "\033%G" utf-8-char)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
433 'escape-quoted)))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
434
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
435 ;; Check that the reverse mapping holds.
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
436 (Assert (equal (unicode-code-point-to-utf-8-string
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
437 (encode-char xemacs-character 'ucs))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
438 utf-8-char))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
439
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
440 ;; Check that, if this character has been JIT-allocated, it is encoded
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
441 ;; in escape-quoted using the corresponding UTF-8 escape.
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
442 (when (charset-property xemacs-charset 'encode-as-utf-8)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
443 (Assert (equal (concat "\033%G" utf-8-char)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
444 (encode-coding-string xemacs-character 'escape-quoted)))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
445 (Assert (equal (concat "\033%G" utf-8-char)
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
446 (encode-coding-string xemacs-character 'ctext))))))
d1754e7f0cea [xemacs-hg @ 2006-06-03 17:50:39 by aidan]
aidan
parents: 2026
diff changeset
447
3952
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
448 (loop
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
449 for (code-point encoded)
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
450 in '((#x10000 "\xd8\x00\xdc\x00")
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
451 (#x10FFFD "\xdb\xff\xdf\xfd"))
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
452 do (Assert (equal (encode-coding-string
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
453 (decode-char 'ucs code-point) 'utf-16)
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
454 encoded)))
3584cb2c07db [xemacs-hg @ 2007-05-13 11:11:28 by aidan]
aidan
parents: 3948
diff changeset
455
1195
dff007bd492b [xemacs-hg @ 2003-01-09 12:49:36 by stephent]
stephent
parents: 875
diff changeset
456 ;;---------------------------------------------------------------
3690
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
457 ;; Regression test for a couple of CCL-related bugs.
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
458 ;;---------------------------------------------------------------
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
459
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
460 (let ((ccl-vector [0 0 0 0 0 0 0 0 0]))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
461 (define-ccl-program ccl-write-two-control-1-chars
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
462 `(1
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
463 ((r0 = ,(charset-id 'control-1))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
464 (r1 = 0)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
465 (write-multibyte-character r0 r1)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
466 (r1 = 31)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
467 (write-multibyte-character r0 r1)))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
468 "CCL program that writes two control-1 multibyte characters.")
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
469
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
470 (Assert (equal
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
471 (ccl-execute-on-string 'ccl-write-two-control-1-chars
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
472 ccl-vector "")
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
473 (format "%c%c" (make-char 'control-1 0)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
474 (make-char 'control-1 31))))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
475
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
476 (define-ccl-program ccl-unicode-two-control-1-chars
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
477 `(1
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
478 ((r0 = ,(charset-id 'control-1))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
479 (r1 = 31)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
480 (mule-to-unicode r0 r1)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
481 (r4 = r0)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
482 (r3 = ,(charset-id 'control-1))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
483 (r2 = 0)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
484 (mule-to-unicode r3 r2)))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
485 "CCL program that writes two control-1 UCS code points in r3 and r4")
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
486
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
487 ;; Re-initialise the vector, mainly to clear the instruction counter,
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
488 ;; which is its last element.
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
489 (setq ccl-vector [0 0 0 0 0 0 0 0 0])
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
490
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
491 (ccl-execute-on-string 'ccl-unicode-two-control-1-chars ccl-vector "")
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
492
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
493 (Assert (and (eq (aref ccl-vector 3)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
494 (encode-char (make-char 'control-1 0) 'ucs))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
495 (eq (aref ccl-vector 4)
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
496 (encode-char (make-char 'control-1 31) 'ucs)))))
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
497
4295
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
498
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
499 ;; Test the 8 bit fixed-width coding systems for round-trip
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
500 ;; compatibility with themselves.
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
501 (loop
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
502 for coding-system in (coding-system-list)
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
503 with all-possible-octets = (apply #'string
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
504 (loop for i from ?\x00 to ?\xFF
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
505 collect i))
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
506 do
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
507 (when (and (coding-system-get coding-system '8-bit-fixed)
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
508 ;; Don't check the coding systems with autodetect, they are
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
509 ;; not round-trip compatible for the possible line-ending
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
510 ;; characters.
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
511 (string-match #r"-\(unix\|dos\|mac\)$"
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
512 (symbol-name coding-system)))
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
513 ;; These coding systems are round-trip compatible with themselves.
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
514 (Assert (equal (encode-coding-string
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
515 (decode-coding-string all-possible-octets
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
516 coding-system)
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
517 coding-system)
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
518 all-possible-octets))))
eded49463f9a [xemacs-hg @ 2007-11-29 13:37:51 by aidan]
aidan
parents: 4133
diff changeset
519
3690
d6a215ad08b8 [xemacs-hg @ 2006-11-20 19:21:47 by aidan]
aidan
parents: 3472
diff changeset
520 ;;---------------------------------------------------------------
1195
dff007bd492b [xemacs-hg @ 2003-01-09 12:49:36 by stephent]
stephent
parents: 875
diff changeset
521 ;; Test charset-in-* functions
dff007bd492b [xemacs-hg @ 2003-01-09 12:49:36 by stephent]
stephent
parents: 875
diff changeset
522 ;;---------------------------------------------------------------
dff007bd492b [xemacs-hg @ 2003-01-09 12:49:36 by stephent]
stephent
parents: 875
diff changeset
523 (with-temp-buffer
dff007bd492b [xemacs-hg @ 2003-01-09 12:49:36 by stephent]
stephent
parents: 875
diff changeset
524 (insert-file-contents (locate-data-file "HELLO"))
3927
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
525 (Assert (equal
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
526 ;; The sort is to make the algorithm of charsets-in-region
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
527 ;; irrelevant.
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
528 (sort (charsets-in-region (point-min) (point-max))
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
529 #'string<)
3927
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
530 '(arabic-1-column arabic-2-column ascii chinese-big5-1
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
531 chinese-gb2312 cyrillic-iso8859-5 ethiopic greek-iso8859-7
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
532 hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
533 katakana-jisx0201 korean-ksc5601 latin-iso8859-1
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
534 latin-iso8859-2 thai-xtis vietnamese-viscii-lower)))
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
535 (Assert (equal
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
536 (sort (charsets-in-string (buffer-substring (point-min)
1316
59e2c5b1e38f [xemacs-hg @ 2003-02-20 15:39:38 by stephent]
stephent
parents: 1195
diff changeset
537 (point-max)))
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
538 #'string<)
3927
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
539 '(arabic-1-column arabic-2-column ascii chinese-big5-1
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
540 chinese-gb2312 cyrillic-iso8859-5 ethiopic greek-iso8859-7
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
541 hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
542 katakana-jisx0201 korean-ksc5601 latin-iso8859-1
cd487eafbc76 [xemacs-hg @ 2007-04-29 13:19:55 by aidan]
aidan
parents: 3701
diff changeset
543 latin-iso8859-2 thai-xtis vietnamese-viscii-lower))))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
544
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
545 ;;---------------------------------------------------------------
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
546 ;; Language environments, and whether the specified values are sane.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
547 ;;---------------------------------------------------------------
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
548 (loop
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
549 for language in (mapcar #'car language-info-alist)
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
550 with language-input-method = nil
4305
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
551 with native-coding-system = nil
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
552 do
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
553 ;; s-l-e can call #'require, which says "Loading ..."
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
554 (Silence-Message (set-language-environment language))
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
555 (Assert (equal language current-language-environment))
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
556
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
557 (setq language-input-method
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
558 (get-language-info language 'input-method))
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
559 (when (and language-input-method
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
560 ;; #### Not robust, if more input methods besides canna are
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
561 ;; in core. The intention of this is that if *any* of the
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
562 ;; packages' input methods are available, we check that *all*
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
563 ;; of the language environments' input methods actually
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
564 ;; exist, which goes against the spirit of non-monolithic
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
565 ;; packages. But I don't have a better approach to this.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
566 (> (length input-method-alist) 1))
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
567 (Assert (assoc language-input-method input-method-alist))
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
568 (Skip-Test-Unless
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
569 (assoc language-input-method input-method-alist)
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
570 "input method unavailable"
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
571 (format "check that IM %s can be activated" language-input-method)
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
572 ;; s-i-m can load files.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
573 (Silence-Message
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
574 (set-input-method language-input-method))
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
575 (Assert (equal language-input-method current-input-method))))
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
576
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
577 (dolist (charset (get-language-info language 'charset))
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
578 (Assert (charsetp (find-charset charset))))
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
579 (dolist (coding-system (get-language-info language 'coding-system))
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
580 (Assert (coding-system-p (find-coding-system coding-system))))
4305
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
581 (dolist (coding-system
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
582 (if (listp (setq native-coding-system
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
583 (get-language-info language
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
584 'native-coding-system)))
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
585 native-coding-system
2bb3630ea397 [xemacs-hg @ 2007-12-04 20:40:49 by aidan]
aidan
parents: 4295
diff changeset
586 (list native-coding-system)))
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
587 ;; We don't have the appropriate POSIX locales to test with a
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
588 ;; native-coding-system that is a function.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
589 (unless (functionp coding-system)
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
590 (Assert (coding-system-p (find-coding-system coding-system))))))
3970
949ac151a10d [xemacs-hg @ 2007-05-20 20:09:20 by aidan]
aidan
parents: 3952
diff changeset
591
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
592 (with-temp-buffer
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
593 (flet
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
594 ((Assert-elc-is-escape-quoted ()
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
595 "Assert the current buffer has an escape-quoted cookie if compiled."
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
596 (save-excursion
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
597 (let ((byte-compile-result (byte-compile-from-buffer
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
598 (current-buffer) nil nil))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
599 (temporary-file-name (make-temp-name
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
600 (expand-file-name "zjPQ2Pk"
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
601 (temp-directory)))))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
602 (byte-compile-insert-header
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
603 temporary-file-name
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
604 (current-buffer)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
605 byte-compile-result)
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
606 (Assert (string-match
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
607 "^;;;###coding system: escape-quoted"
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
608 (buffer-substring nil nil byte-compile-result))))))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
609 (Assert-elc-has-no-specified-encoding ()
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
610 "Assert the current buffer has no coding cookie if compiled."
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
611 (save-excursion
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
612 (let ((byte-compile-result (byte-compile-from-buffer
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
613 (current-buffer) nil nil))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
614 (temporary-file-name (make-temp-name
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
615 (expand-file-name "zjPQ2Pk"
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
616 (temp-directory)))))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
617 (byte-compile-insert-header
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
618 temporary-file-name
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
619 (current-buffer)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
620 byte-compile-result)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
621 (Assert (not (string-match
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
622 ";;;###coding system:"
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
623 (buffer-substring nil nil
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
624 byte-compile-result))))))))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
625 (insert
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
626 ;; Create a buffer with Unicode escapes. The #'read call is at
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
627 ;; runtime, because this file may be compiled and read in a non-Mule
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
628 ;; XEmacs. (But it won't be run.)
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
629 (read
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
630 "#r\" (defvar testing-mule-compilation-handling
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
631 (string ?\\u371E ;; kDefinition beautiful; pretty, used
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
632 ;; in girl's name
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
633 ?\\U0002A6A9 ;; kDefinition (Cant.) sound of shouting
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
634 ?\\U0002A65B ;; kDefinition (Cant.) decayed teeth;
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
635 ;; tongue-tied
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
636 ?\\U00010400 ;; DESERET CAPITAL LETTER LONG I
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
637 ?\\u3263)) ;; CIRCLED HANGUL RIEUL \""))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
638
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
639 (Assert-elc-is-escape-quoted)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
640 (delete-region (point-min) (point-max))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
641
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
642 (insert
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
643 ;; This time, the buffer will contain the actual characters, because of
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
644 ;; u flag to the #r.
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
645 (read
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
646 "#ru\" (defvar testing-mule-compilation-handling
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
647 (string ?\\u371E ;; kDefinition beautiful; pretty, used
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
648 ;; in girl's name
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
649 ?\\U0002A6A9 ;; kDefinition (Cant.) sound of shouting
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
650 ?\\U0002A65B ;; kDefinition (Cant.) decayed teeth;
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
651 ;; tongue-tied
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
652 ?\\U00010400 ;; DESERET CAPITAL LETTER LONG I
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
653 ?\\u3263)) ;; CIRCLED HANGUL RIEUL \""))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
654
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
655 (Assert-elc-is-escape-quoted)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
656 (delete-region (point-min) (point-max))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
657
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
658 (insert
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
659 ;; Just a single four character escape.
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
660 (read
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
661 "#r\" (defvar testing-mule-compilation-handling
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
662 (string ?\\u371E)) ;; kDefinition beautiful; pretty, used\""))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
663
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
664 (Assert-elc-is-escape-quoted)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
665 (delete-region (point-min) (point-max))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
666
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
667 (insert
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
668 ;; Just a single eight character escape.
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
669 (read
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
670 "#r\" (defvar testing-mule-compilation-handling
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
671 (string ?\\U0002A65B)) ;; kDefinition (Cant.) decayed teeth;\""))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
672
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
673 (Assert-elc-is-escape-quoted)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
674 (delete-region (point-min) (point-max))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
675
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
676 (insert
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
677 ;; A single latin-1 hex digit escape No run-time #'read call,
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
678 ;; non-Mule can handle this too.
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
679 #r" (defvar testing-mule-compilation-handling
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
680 (string ?\xab)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK")
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
681
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
682 (Assert-elc-has-no-specified-encoding)
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
683 (delete-region (point-min) (point-max))
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
684
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
685 (insert
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
686 ;; A single latin-1 character. No run-time #'read call.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
687 #ru" (defvar testing-mule-compilation-handling
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
688 (string ?\u00AB)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\")")
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
689
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
690 (Assert-elc-has-no-specified-encoding)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
691 (delete-region (point-min) (point-max))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
692
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
693 (insert
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
694 ;; Just ASCII. No run-time #'read call
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
695 #r" (defvar testing-mule-compilation-handling
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
696 (string ?A)) ;; LATIN CAPITAL LETTER A")
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
697
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
698 (Assert-elc-has-no-specified-encoding)
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
699 (delete-region (point-min) (point-max))
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
700
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
701 ;; This bug exists because the coding-cookie insertion code looks at
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
702 ;; the input buffer, not the output buffer.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
703 ;;
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
704 ;; It looks at the input buffer because byte-compile-dynamic and
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
705 ;; byte-compile-dynamic-docstrings currently need to be
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
706 ;; unconditionally turned off for Mule files, since dynamic
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
707 ;; compilation of function bodies and docstrings fails if you can't
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
708 ;; call (point) and trivially get the byte offset in the file.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
709 ;;
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
710 ;; And to unconditionally turn those two features off, you need to
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
711 ;; know before byte-compilation whether the byte-compilation output
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
712 ;; file contains non-Latin-1 characters, or perhaps to check after
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
713 ;; compilation and redo; but we don't do the latter.
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
714 ;;
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
715 ;; To fix this bug, we need to add Mule support to
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
716 ;; byte-compile-dynamic and byte-compile-dynamic-docstrings. Or drop
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
717 ;; support for those features entirely.
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
718 (insert
4133
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
719 "(defvar testing-mule-compilation-handling (eval-when-compile
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
720 (decode-char 'ucs #x371e))) ;; kDefinition beautiful; pretty, used\"")
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
721 (Known-Bug-Expect-Failure
5b55fa103aa1 [xemacs-hg @ 2007-08-21 12:38:57 by aidan]
aidan
parents: 4026
diff changeset
722 (Assert-elc-is-escape-quoted))
3948
adecfd791c9b [xemacs-hg @ 2007-05-12 10:17:00 by aidan]
aidan
parents: 3927
diff changeset
723 (delete-region (point-min) (point-max))))
4318
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
724
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
725 (Known-Bug-Expect-Error
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
726 invalid-constant
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
727 (loop
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
728 for i from #x0 to #x10FFFF
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
729 with exceptions = #s(range-table type start-closed-end-closed
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
730 data ((#xFFFE #xFFFF) t
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
731 (#xFDD0 #xFDEF) t
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
732 (#xD800 #xDBFF) t
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
733 (#xDC00 #xDFFF) t))
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
734 do (unless (get-range-table i exceptions)
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
735 (read (format (if (> i #xFFFF) #r"?\U%08X" #r"?\u%04X") i)))
4d0f773d5e21 Fix the test failures introduced by the non-ISO-2022 coding systems.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4305
diff changeset
736 finally return t))
434
9d177e8d4150 Import from CVS: tag r21-2-25
cvs
parents: 428
diff changeset
737 )