Mercurial > hg > xemacs-beta
diff tests/automated/mule-tests.el @ 4295:eded49463f9a
[xemacs-hg @ 2007-11-29 13:37:51 by aidan]
Add round-trip tests for my fixed-width-8-bit CCL coding systems, fix a bug
with them, take out some inadvertant debugging code of mine from mule-ccl.c.
author | aidan |
---|---|
date | Thu, 29 Nov 2007 13:38:21 +0000 |
parents | 5b55fa103aa1 |
children | 2bb3630ea397 |
line wrap: on
line diff
--- a/tests/automated/mule-tests.el Wed Nov 28 22:51:17 2007 +0000 +++ b/tests/automated/mule-tests.el Thu Nov 29 13:38:21 2007 +0000 @@ -495,6 +495,28 @@ (eq (aref ccl-vector 4) (encode-char (make-char 'control-1 31) 'ucs))))) + + ;; Test the 8 bit fixed-width coding systems for round-trip + ;; compatibility with themselves. + (loop + for coding-system in (coding-system-list) + with all-possible-octets = (apply #'string + (loop for i from ?\x00 to ?\xFF + collect i)) + do + (when (and (coding-system-get coding-system '8-bit-fixed) + ;; Don't check the coding systems with autodetect, they are + ;; not round-trip compatible for the possible line-ending + ;; characters. + (string-match #r"-\(unix\|dos\|mac\)$" + (symbol-name coding-system))) + ;; These coding systems are round-trip compatible with themselves. + (Assert (equal (encode-coding-string + (decode-coding-string all-possible-octets + coding-system) + coding-system) + all-possible-octets)))) + ;;--------------------------------------------------------------- ;; Test charset-in-* functions ;;---------------------------------------------------------------