annotate tests/automated/case-tests.el @ 4133:5b55fa103aa1

[xemacs-hg @ 2007-08-21 12:38:57 by aidan] Clean up tests/automated/mule-test.el, fix a problem revealed by it.
author aidan
date Tue, 21 Aug 2007 12:39:15 +0000
parents 0784d089fdc9
children df576f30c1d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
1 ;;; -*- coding: iso-8859-1 -*-
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
2
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
3 ;; Copyright (C) 2000 Free Software Foundation, Inc.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
4
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
5 ;; Author: Yoshiki Hayashi <yoshiki@xemacs.org>
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
6 ;; Maintainer: Yoshiki Hayashi <yoshiki@xemacs.org>
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
7 ;; Created: 2000
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
8 ;; Keywords: tests
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
9
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
11
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
15 ;; any later version.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
16
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
20 ;; General Public License for more details.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
21
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
25 ;; 02111-1307, USA.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
26
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
27 ;;; Synched up with: Not in FSF.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
28
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
29 ;;; Commentary:
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
30
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
31 ;; Test case-table related functionality.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
32
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
33 (Assert (case-table-p (standard-case-table)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
34 ;; Old case table test.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
35 (Assert (case-table-p (list
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
36 (make-string 256 ?a)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
37 nil nil nil)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
38 (Assert (case-table-p (list
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
39 (make-string 256 ?a)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
40 (make-string 256 ?b)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
41 nil nil)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
42 (Assert (case-table-p (list
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
43 (make-string 256 ?a)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
44 (make-string 256 ?b)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
45 (make-string 256 ?c)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
46 nil)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
47 (Assert (case-table-p (list
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
48 (make-string 256 ?a)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
49 (make-string 256 ?b)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
50 (make-string 256 ?c)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
51 (make-string 256 ?d))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
52 (Assert (not (case-table-p (list (make-string 256 ?a)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
53 (make-string 256 ?b)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
54 (make-string 256 ?c)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
55 (make-string 254 ?d)))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
56 (Assert (not (case-table-p (list (make-string 256 ?a)))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
57
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
58 (Assert (case-table-p (set-case-table (current-case-table))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
59
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
60 (defvar string-0-through-32
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
61 (let ((result (make-string 33 (int-to-char 0))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
62 (dotimes (i 33)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
63 (aset result i (int-to-char i)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
64 result)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
65 "String containing characters from code point 0 (NUL) through 32 (SPC).")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
66
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
67 (defvar string-127-through-160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
68 (let ((result (make-string 34 (int-to-char 0))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
69 (dotimes (i 34)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
70 (aset result i (int-to-char (+ 127 i))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
71 result)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
72 "String containing characters from code point 127 (DEL) through 160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
73 \(no-break-space).")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
74
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
75 ;; Case table sanity check.
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
76 (let ((downcase-string
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
77 (concat string-0-through-32
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
78 "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
79 string-127-through-160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
80 "¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
81 (upcase-string
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
82 (concat string-0-through-32
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
83 "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
84 string-127-through-160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
85 "¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
86 (table (standard-case-table)))
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
87 (dotimes (i 256)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
88 (Assert (eq (get-case-table 'downcase (int-to-char i) table)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
89 (aref downcase-string i)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
90 (Assert (eq (get-case-table 'upcase (int-to-char i) table)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
91 (aref upcase-string i)))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
92
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
93 (Check-Error-Message error "Char case must be downcase or upcase"
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
94 (get-case-table 'foo ?a (standard-case-table)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
95
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
96 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
97 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
98 (upcase "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
99 "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
100
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
101 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
102 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
103 (upcase "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
104 "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
105
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
106 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
107 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
108 (upcase " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
109 " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
110
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
111 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
112 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
113 (upcase " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
114 " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
115
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
116 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
117 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
118 (downcase "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
119 "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
120
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
121 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
122 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
123 (downcase "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
124 "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
125
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
126 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
127 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
128 (downcase " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
129 " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
130
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
131 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
132 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
133 (downcase " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
134 " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
135
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
136 ;; Old case table format test.
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
137 (with-temp-buffer
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
138 (set-case-table
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
139 (list
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
140 (concat string-0-through-32
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
141 "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
142 string-127-through-160
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 446
diff changeset
143 "¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ")
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
144 nil nil nil))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
145 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
146 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
147 (upcase "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
148 "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
149 (Assert
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
150 (string=
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
151 (downcase "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
152 "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz")))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
153
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
154 (with-temp-buffer
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
155 (insert "Test Buffer")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
156 (let ((case-fold-search t))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
157 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
158 (Assert (eq (search-forward "test buffer" nil t) 12))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
159 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
160 (Assert (eq (search-forward "Test buffer" nil t) 12))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
161 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
162 (Assert (eq (search-forward "Test Buffer" nil t) 12))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
163
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
164 (setq case-fold-search nil)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
165 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
166 (Assert (not (search-forward "test buffer" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
167 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
168 (Assert (not (search-forward "Test buffer" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
169 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
170 (Assert (eq (search-forward "Test Buffer" nil t) 12))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
171
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
172 (with-temp-buffer
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
173 (insert "abcdefghijklmnäopqrstuÄvwxyz")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
174 ;; case insensitive
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
175 (Assert (not (search-forward "ö" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
176 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
177 (Assert (eq 16 (search-forward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
178 (Assert (eq 24 (search-forward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
179 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
180 (Assert (eq 16 (search-forward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
181 (Assert (eq 24 (search-forward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
182 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
183 (Assert (eq 23 (search-backward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
184 (Assert (eq 15 (search-backward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
185 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
186 (Assert (eq 23 (search-backward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
187 (Assert (eq 15 (search-backward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
188 ;; case sensitive
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
189 (setq case-fold-search nil)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
190 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
191 (Assert (not (search-forward "ö" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
192 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
193 (Assert (eq 16 (search-forward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
194 (Assert (not (search-forward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
195 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
196 (Assert (eq 24 (search-forward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
197 (goto-char 16)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
198 (Assert (eq 24 (search-forward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
199 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
200 (Assert (eq 15 (search-backward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
201 (goto-char 15)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
202 (Assert (not (search-backward "ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
203 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
204 (Assert (eq 23 (search-backward "Ä" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
205 (Assert (not (search-backward "Ä" nil t))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
206
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
207 (with-temp-buffer
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
208 (insert "aaaaäÄäÄäÄäÄäÄbbbb")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
209 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
210 (Assert (eq 15 (search-forward "ää" nil t 5)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
211 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
212 (Assert (not (search-forward "ää" nil t 6)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
213 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
214 (Assert (eq 5 (search-backward "ää" nil t 5)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
215 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
216 (Assert (not (search-backward "ää" nil t 6))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
217
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
218 (when (featurep 'mule)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
219 (let* ((hiragana-a (make-char 'japanese-jisx0208 36 34))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
220 (a-diaeresis ?ä)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
221 (case-table (copy-case-table (standard-case-table)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
222 (str-hiragana-a (char-to-string hiragana-a))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
223 (str-a-diaeresis (char-to-string a-diaeresis))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
224 (string (concat str-hiragana-a str-a-diaeresis)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
225 (put-case-table-pair hiragana-a a-diaeresis case-table)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
226 (with-temp-buffer
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
227 (set-case-table case-table)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
228 (insert hiragana-a "abcdefg" a-diaeresis)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
229 ;; forward
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
230 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
231 (Assert (not (search-forward "ö" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
232 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
233 (Assert (eq 2 (search-forward str-hiragana-a nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
234 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
235 (Assert (eq 2 (search-forward str-a-diaeresis nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
236 (goto-char (1+ (point-min)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
237 (Assert (eq (point-max)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
238 (search-forward str-hiragana-a nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
239 (goto-char (1+ (point-min)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
240 (Assert (eq (point-max)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
241 (search-forward str-a-diaeresis nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
242 ;; backward
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
243 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
244 (Assert (not (search-backward "ö" nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
245 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
246 (Assert (eq (1- (point-max)) (search-backward str-hiragana-a nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
247 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
248 (Assert (eq (1- (point-max)) (search-backward str-a-diaeresis nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
249 (goto-char (1- (point-max)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
250 (Assert (eq 1 (search-backward str-hiragana-a nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
251 (goto-char (1- (point-max)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
252 (Assert (eq 1 (search-backward str-a-diaeresis nil t)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
253 (replace-match "a")
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
254 (Assert (looking-at (format "abcdefg%c" a-diaeresis))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
255 (with-temp-buffer
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
256 (set-case-table case-table)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
257 (insert string)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
258 (insert string)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
259 (insert string)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
260 (insert string)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
261 (insert string)
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
262 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
263 (Assert (eq 11 (search-forward string nil t 5)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
264 (goto-char (point-min))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
265 (Assert (not (search-forward string nil t 6)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
266 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
267 (Assert (eq 1 (search-backward string nil t 5)))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
268 (goto-char (point-max))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
269 (Assert (not (search-backward string nil t 6))))))
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents:
diff changeset
270