Mercurial > hg > xemacs-beta
annotate tests/automated/symbol-tests.el @ 5402:308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Thu, 14 Oct 2010 17:15:20 +0200 |
parents | 0f66906b6e37 |
children | 58b38d5b32d0 |
rev | line source |
---|---|
428 | 1 ;; Copyright (C) 1999 Free Software Foundation, Inc. |
2 | |
3 ;; Author: Hrvoje Niksic <hniksic@xemacs.org> | |
4 ;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> | |
5 ;; Created: 1999 | |
6 ;; Keywords: tests | |
7 | |
8 ;; This file is part of XEmacs. | |
9 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
10 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
11 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
12 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
13 ;; option) any later version. |
428 | 14 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
18 ;; for more details. |
428 | 19 |
20 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
5136
diff
changeset
|
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
428 | 22 |
23 ;;; Synched up with: Not in FSF. | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;; Test symbols operations. | |
28 ;; See test-harness.el for instructions on how to run these tests. | |
29 | |
30 (eval-when-compile | |
31 (condition-case nil | |
32 (require 'test-harness) | |
33 (file-error | |
34 (push "." load-path) | |
35 (when (and (boundp 'load-file-name) (stringp load-file-name)) | |
36 (push (file-name-directory load-file-name) load-path)) | |
37 (require 'test-harness)))) | |
38 | |
39 | |
40 (defun ts-fresh-symbol-name (name) | |
41 "Return a variant of NAME (a string) that is not interned." | |
42 (when (intern-soft name) | |
43 (let ((count 1) | |
44 (orig name)) | |
45 (while (progn | |
46 (setq name (format "%s-%d" orig count)) | |
47 (intern-soft name)) | |
48 (incf count)))) | |
49 name) | |
50 | |
51 ;;----------------------------------------------------- | |
52 ;; Creating, reading, and printing symbols | |
53 ;;----------------------------------------------------- | |
54 | |
55 (dolist (name '("foo" "bar" "" | |
56 "something with space in it" | |
57 "a string with \0 in the middle." | |
58 "100" "10.0" "#<>[]]]];'\\';" | |
59 "!@#$%^^&*(()__")) | |
60 (let ((interned (intern name)) | |
61 (uninterned (make-symbol name))) | |
62 (Assert (symbolp interned)) | |
63 (Assert (symbolp uninterned)) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
64 (Assert (equal (symbol-name interned) name)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
65 (Assert (equal (symbol-name uninterned) name)) |
428 | 66 (Assert (not (eq interned uninterned))) |
67 (Assert (not (equal interned uninterned))))) | |
68 | |
69 (flet ((check-weak-list-unique (weak-list &optional reversep) | |
70 "Check that elements of WEAK-LIST are referenced only there." | |
71 (let ((len (length (weak-list-list weak-list)))) | |
1413 | 72 (if (string-match "Using the new GC algorithms." |
73 Installation-string) | |
74 (Implementation-Incomplete-Expect-Failure | |
75 (Assert (not (zerop len))) | |
76 (garbage-collect) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
77 (Assert (eq (length (weak-list-list weak-list)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
78 (if (not reversep) 0 len)))) |
1413 | 79 (Assert (not (zerop len))) |
80 (garbage-collect) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
81 (Assert (eq (length (weak-list-list weak-list)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
82 (if (not reversep) 0 len))))))) |
428 | 83 (let ((weak-list (make-weak-list)) |
84 (gc-cons-threshold most-positive-fixnum)) | |
85 ;; Symbols created with `make-symbol' and `gensym' should be fresh | |
86 ;; and not referenced anywhere else. We check that no other | |
87 ;; references are available using a weak list. | |
88 (eval | |
89 ;; This statement must not be run byte-compiled, or the values | |
90 ;; remain referenced on the bytecode interpreter stack. | |
91 '(set-weak-list-list weak-list (list (make-symbol "foo") (gensym "foo")))) | |
92 (check-weak-list-unique weak-list) | |
93 | |
94 ;; Equivalent test for `intern' and `gentemp'. | |
95 (eval | |
96 '(set-weak-list-list weak-list | |
97 (list (intern (ts-fresh-symbol-name "foo")) | |
98 (gentemp (ts-fresh-symbol-name "bar"))))) | |
99 (check-weak-list-unique weak-list 'not))) | |
100 | |
101 (Assert (not (intern-soft (make-symbol "foo")))) | |
102 (Assert (not (intern-soft (gensym "foo")))) | |
103 (Assert (intern-soft (intern (ts-fresh-symbol-name "foo")))) | |
104 (Assert (intern-soft (gentemp (ts-fresh-symbol-name "bar")))) | |
105 | |
106 ;; Reading a symbol should intern it automatically, unless the symbol | |
107 ;; is marked specially. | |
108 (dolist (string (mapcar #'ts-fresh-symbol-name '("foo" "bar" "\\\0\\\1"))) | |
109 (setq symbol (read string) | |
110 string (read (concat "\"" string "\""))) | |
111 (Assert (intern-soft string)) | |
112 (Assert (intern-soft symbol)) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
113 (Assert (eq (intern-soft string) (intern-soft symbol)))) |
428 | 114 |
115 (let ((fresh (read (concat "#:" (ts-fresh-symbol-name "foo"))))) | |
116 (Assert (not (intern-soft fresh)))) | |
117 | |
118 ;; Check #N=OBJECT and #N# read syntax. | |
119 (let* ((list (read "(#1=#:foo #1# #2=#:bar #2# #1# #2#)")) | |
120 (foo (nth 0 list)) | |
121 (foo2 (nth 1 list)) | |
122 (bar (nth 2 list)) | |
123 (bar2 (nth 3 list)) | |
124 (foo3 (nth 4 list)) | |
125 (bar3 (nth 5 list))) | |
126 (Assert (symbolp foo)) | |
127 (Assert (not (intern-soft foo))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
128 (Assert (equal (symbol-name foo) "foo")) |
428 | 129 (Assert (symbolp bar)) |
130 (Assert (not (intern-soft bar))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
131 (Assert (equal (symbol-name bar) "bar")) |
428 | 132 |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
133 (Assert (eq foo foo2)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
134 (Assert (eq foo2 foo3)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
135 (Assert (eq bar bar2)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
136 (Assert (eq bar2 bar3))) |
428 | 137 |
138 ;; Check #N=OBJECT and #N# print syntax. | |
139 (let* ((foo (make-symbol "foo")) | |
140 (bar (make-symbol "bar")) | |
141 (list (list foo foo bar bar foo bar))) | |
142 (let* ((print-gensym nil) | |
143 (printed-list (prin1-to-string list))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
144 (Assert (equal printed-list "(foo foo bar bar foo bar)"))) |
428 | 145 (let* ((print-gensym t) |
146 (printed-list (prin1-to-string list))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
147 (Assert (equal printed-list "(#1=#:foo #1# #2=#:bar #2# #1# #2#)")))) |
428 | 148 |
149 ;;----------------------------------------------------- | |
150 ;; Read-only symbols | |
151 ;;----------------------------------------------------- | |
152 | |
153 (Check-Error setting-constant | |
154 (set nil nil)) | |
155 (Check-Error setting-constant | |
156 (set t nil)) | |
157 | |
158 ;;----------------------------------------------------- | |
159 ;; Variable indirections | |
160 ;;----------------------------------------------------- | |
161 | |
162 (let ((foo 0) | |
163 (bar 1)) | |
164 (defvaralias 'foo 'bar) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
165 (Assert (eq foo bar)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
166 (Assert (eq foo 1)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
167 (Assert (eq (variable-alias 'foo) 'bar)) |
428 | 168 (defvaralias 'bar 'foo) |
169 (Check-Error cyclic-variable-indirection | |
170 (symbol-value 'foo)) | |
171 (Check-Error cyclic-variable-indirection | |
172 (symbol-value 'bar)) | |
173 (defvaralias 'foo nil) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
174 (Assert (eq foo 0)) |
428 | 175 (defvaralias 'bar nil) |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
176 (Assert (eq bar 1))) |
428 | 177 |
178 ;;----------------------------------------------------- | |
179 ;; Keywords | |
180 ;;----------------------------------------------------- | |
181 | |
182 ;;; Reading keywords | |
183 | |
184 ;; In Elisp, a keyword is by definition a symbol beginning with `:' | |
185 ;; that is interned in the global obarray. | |
186 | |
187 ;; In Elisp, a keyword is interned as any other symbol. | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
188 (Assert (eq (read ":foo") (intern ":foo"))) |
428 | 189 |
190 ;; A keyword is self-quoting and evaluates to itself. | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
191 (Assert (eq (eval (intern ":foo")) :foo)) |
428 | 192 |
193 ;; Keywords are recognized as such only if interned in the global | |
194 ;; obarray, and `keywordp' is aware of that. | |
195 (Assert (keywordp :foo)) | |
196 (Assert (not (keywordp (intern ":foo" [0])))) | |
197 | |
198 ;; Keywords used to be initialized at read-time, which resulted in | |
199 ;; (symbol-value (intern ":some-new-keyword")) signaling an error. | |
200 ;; Now we handle keywords at the time when the symbol is interned, so | |
201 ;; that (intern ":something) and (read ":something) will be | |
202 ;; equivalent. These tests check various operations on symbols that | |
203 ;; are guaranteed to be freshly interned. | |
204 | |
205 ;; Interning a fresh keyword string should produce a regular | |
206 ;; keyword. | |
207 (let* ((fresh-keyword-name (ts-fresh-symbol-name ":foo")) | |
208 (fresh-keyword (intern fresh-keyword-name))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
209 (Assert (eq (symbol-value fresh-keyword) fresh-keyword)) |
428 | 210 (Assert (keywordp fresh-keyword))) |
211 | |
212 ;; Likewise, reading a fresh keyword string should produce a regular | |
213 ;; keyword. | |
214 (let* ((fresh-keyword-name (ts-fresh-symbol-name ":foo")) | |
215 (fresh-keyword (read fresh-keyword-name))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
216 (Assert (eq (symbol-value fresh-keyword) fresh-keyword)) |
428 | 217 (Assert (keywordp fresh-keyword))) |
218 | |
219 ;;; Assigning to keywords | |
220 | |
221 ;; You shouldn't be able to set its value to something bogus. | |
222 (Check-Error setting-constant | |
223 (set :foo 5)) | |
224 | |
225 ;; But, for backward compatibility, setting to the same value is OK. | |
226 (Assert | |
227 (eq (set :foo :foo) :foo)) | |
228 | |
229 ;; Playing games with `intern' shouldn't fool us. | |
230 (Check-Error setting-constant | |
231 (set (intern ":foo" obarray) 5)) | |
232 (Assert | |
233 (eq (set (intern ":foo" obarray) :foo) :foo)) | |
234 | |
235 ;; But symbols not interned in the global obarray are not real | |
236 ;; keywords (in elisp): | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
237 (Assert (eq (set (intern ":foo" [0]) 5) 5)) |
428 | 238 |
239 ;;; Printing keywords | |
240 | |
241 (let ((print-gensym t)) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
242 (Assert (equal (prin1-to-string :foo) ":foo")) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
243 (Assert (equal (prin1-to-string (intern ":foo")) ":foo")) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
244 (Assert (equal (prin1-to-string (intern ":foo" [0])) "#::foo"))) |
428 | 245 |
246 (let ((print-gensym nil)) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
247 (Assert (equal (prin1-to-string :foo) ":foo")) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
248 (Assert (equal (prin1-to-string (intern ":foo")) ":foo")) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
249 (Assert (equal (prin1-to-string (intern ":foo" [0])) ":foo"))) |
428 | 250 |
251 ;; #### Add many more tests for printing and reading symbols, as well | |
252 ;; as print-gensym and print-gensym-alist! | |
253 | |
254 ;;----------------------------------------------------- | |
255 ;; Magic symbols | |
256 ;;----------------------------------------------------- | |
257 | |
440 | 258 ;; Magic symbols are only half implemented. However, a subset of the |
259 ;; functionality is being used to implement backward compatibility or | |
260 ;; clearer error messages for new features such as specifiers and | |
261 ;; glyphs. These tests try to test that working subset. | |
428 | 262 |
440 | 263 (let ((mysym (make-symbol "test-symbol")) |
264 save) | |
428 | 265 (dontusethis-set-symbol-value-handler |
266 mysym | |
267 'set-value | |
268 (lambda (&rest args) | |
269 (throw 'test-tag args))) | |
440 | 270 (Assert (not (boundp mysym))) |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
271 (Assert (equal (catch 'test-tag |
428 | 272 (set mysym 'foo)) |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
273 `(,mysym (foo) set nil nil))) |
440 | 274 (Assert (not (boundp mysym))) |
275 (dontusethis-set-symbol-value-handler | |
276 mysym | |
277 'set-value | |
278 (lambda (&rest args) (setq save (nth 1 args)))) | |
279 (set mysym 'foo) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
280 (Assert (equal save '(foo))) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
281 (Assert (eq (symbol-value mysym) 'foo)) |
440 | 282 ) |
428 | 283 |
440 | 284 (let ((mysym (make-symbol "test-symbol")) |
285 save) | |
286 (dontusethis-set-symbol-value-handler | |
287 mysym | |
288 'make-unbound | |
289 (lambda (&rest args) | |
290 (throw 'test-tag args))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
291 (Assert (equal (catch 'test-tag |
440 | 292 (makunbound mysym)) |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
293 `(,mysym nil makunbound nil nil))) |
440 | 294 (dontusethis-set-symbol-value-handler |
295 mysym | |
296 'make-unbound | |
297 (lambda (&rest args) (setq save (nth 2 args)))) | |
298 (Assert (not (boundp mysym))) | |
299 (set mysym 'bar) | |
300 (Assert (null save)) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
301 (Assert (eq (symbol-value mysym) 'bar)) |
440 | 302 (makunbound mysym) |
303 (Assert (not (boundp mysym))) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
304 (Assert (eq save 'makunbound)) |
440 | 305 ) |
306 | |
826 | 307 ;; pathname-coding-system is no more. |
308 ; (when (featurep 'file-coding) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
309 ; (Assert (eq pathname-coding-system file-name-coding-system)) |
826 | 310 ; (let ((val1 file-name-coding-system) |
311 ; (val2 pathname-coding-system)) | |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
312 ; (Assert (eq val1 val2)) |
826 | 313 ; (let ((file-name-coding-system 'no-conversion-dos)) |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
314 ; (Assert (eq file-name-coding-system 'no-conversion-dos)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
315 ; (Assert (eq pathname-coding-system file-name-coding-system))) |
826 | 316 ; (let ((pathname-coding-system 'no-conversion-mac)) |
5136
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
317 ; (Assert (eq file-name-coding-system 'no-conversion-mac)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
318 ; (Assert (eq pathname-coding-system file-name-coding-system))) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
319 ; (Assert (eq file-name-coding-system pathname-coding-system)) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
320 ; (Assert (eq val1 file-name-coding-system))) |
0f66906b6e37
Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents:
4855
diff
changeset
|
321 ; (Assert (eq pathname-coding-system file-name-coding-system))) |
440 | 322 |
428 | 323 |
324 ;(let ((mysym (make-symbol "test-symbol"))) | |
325 ; (dontusethis-set-symbol-value-handler | |
326 ; mysym | |
327 ; 'make-local | |
328 ; (lambda (&rest args) | |
329 ; (throw 'test-tag args))) | |
330 ; (Assert (equal (catch 'test-tag | |
331 ; (set mysym 'foo)) | |
440 | 332 ; `(,mysym (foo) make-local nil nil)))) |
4381
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
333 |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
334 ;; ---------------------------------------------------------------- |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
335 ;; Symbol documentation |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
336 ;; ---------------------------------------------------------------- |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
337 |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
338 ;; built-in variable documentation |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
339 (Assert (string= (built-in-symbol-file 'internal-doc-file-name) |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
340 "doc.c")) |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
341 |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
342 ;; built-in function documentation |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
343 (Assert (string= (built-in-symbol-file 'built-in-symbol-file) |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
344 "doc.c")) |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
345 |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
346 ;; built-in macro documentation |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
347 (Assert (string= (built-in-symbol-file 'when) |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
348 "eval.c")) |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
349 |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
350 ;; #### we should handle symbols defined in Lisp, dumped, autoloaded, |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
351 ;; and required, too. |
3906442b491b
Improve style and add tests for 'built-in-symbol-file'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
1413
diff
changeset
|
352 |