Mercurial > hg > xemacs-beta
comparison tests/automated/mule-tests.el @ 434:9d177e8d4150 r21-2-25
Import from CVS: tag r21-2-25
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:30:53 +0200 |
parents | 3ecd8885ac67 |
children | 84b14dcb0985 |
comparison
equal
deleted
inserted
replaced
433:892ca416f0fb | 434:9d177e8d4150 |
---|---|
26 | 26 |
27 ;;; Commentary: | 27 ;;; Commentary: |
28 | 28 |
29 ;; Test some Mule functionality (most of these remain to be written) . | 29 ;; Test some Mule functionality (most of these remain to be written) . |
30 ;; See test-harness.el for instructions on how to run these tests. | 30 ;; See test-harness.el for instructions on how to run these tests. |
31 | |
32 ;; This file will be (read)ed by a non-mule XEmacs, so don't use | |
33 ;; literal non-Latin1 characters. Use (make-char) instead. | |
31 | 34 |
32 ;;----------------------------------------------------------------- | 35 ;;----------------------------------------------------------------- |
33 ;; Test whether all legal chars may be safely inserted to a buffer. | 36 ;; Test whether all legal chars may be safely inserted to a buffer. |
34 ;;----------------------------------------------------------------- | 37 ;;----------------------------------------------------------------- |
35 | 38 |
71 ;; It would be really *really* nice if test-harness allowed a way to | 74 ;; It would be really *really* nice if test-harness allowed a way to |
72 ;; run a test in byte-compiled mode only. It's tedious to have | 75 ;; run a test in byte-compiled mode only. It's tedious to have |
73 ;; time-consuming tests like this one run twice, once interpreted and | 76 ;; time-consuming tests like this one run twice, once interpreted and |
74 ;; once compiled, for no good reason. | 77 ;; once compiled, for no good reason. |
75 (test-chars t) | 78 (test-chars t) |
79 | |
80 ;;----------------------------------------------------------------- | |
81 ;; Test string modification functions that modify the length of a char. | |
82 ;;----------------------------------------------------------------- | |
83 | |
84 (when (featurep 'mule) | |
85 ;; Test fillarray | |
86 (macrolet | |
87 ((fillarray-test | |
88 (charset1 charset2) | |
89 (let ((char1 (make-char charset1 69)) | |
90 (char2 (make-char charset2 69))) | |
91 `(let ((string (make-string 1000 ,char1))) | |
92 (fillarray string ,char2) | |
93 (Assert (eq (aref string 0) ,char2)) | |
94 (Assert (eq (aref string (1- (length string))) ,char2)) | |
95 (Assert (eq (length string) 1000)))))) | |
96 (fillarray-test ascii latin-iso8859-1) | |
97 (fillarray-test ascii latin-iso8859-2) | |
98 (fillarray-test latin-iso8859-1 ascii) | |
99 (fillarray-test latin-iso8859-2 ascii)) | |
100 | |
101 ;; Test aset | |
102 (let ((string (string (make-char 'ascii 69) (make-char 'latin-iso8859-2 69)))) | |
103 (aset string 0 (make-char 'latin-iso8859-2 42)) | |
104 (Assert (eq (aref string 1) (make-char 'latin-iso8859-2 69)))) | |
105 | |
106 ) |