comparison 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
comparison
equal deleted inserted replaced
4294:01a2c678e91f 4295:eded49463f9a
492 492
493 (Assert (and (eq (aref ccl-vector 3) 493 (Assert (and (eq (aref ccl-vector 3)
494 (encode-char (make-char 'control-1 0) 'ucs)) 494 (encode-char (make-char 'control-1 0) 'ucs))
495 (eq (aref ccl-vector 4) 495 (eq (aref ccl-vector 4)
496 (encode-char (make-char 'control-1 31) 'ucs))))) 496 (encode-char (make-char 'control-1 31) 'ucs)))))
497
498
499 ;; Test the 8 bit fixed-width coding systems for round-trip
500 ;; compatibility with themselves.
501 (loop
502 for coding-system in (coding-system-list)
503 with all-possible-octets = (apply #'string
504 (loop for i from ?\x00 to ?\xFF
505 collect i))
506 do
507 (when (and (coding-system-get coding-system '8-bit-fixed)
508 ;; Don't check the coding systems with autodetect, they are
509 ;; not round-trip compatible for the possible line-ending
510 ;; characters.
511 (string-match #r"-\(unix\|dos\|mac\)$"
512 (symbol-name coding-system)))
513 ;; These coding systems are round-trip compatible with themselves.
514 (Assert (equal (encode-coding-string
515 (decode-coding-string all-possible-octets
516 coding-system)
517 coding-system)
518 all-possible-octets))))
497 519
498 ;;--------------------------------------------------------------- 520 ;;---------------------------------------------------------------
499 ;; Test charset-in-* functions 521 ;; Test charset-in-* functions
500 ;;--------------------------------------------------------------- 522 ;;---------------------------------------------------------------
501 (with-temp-buffer 523 (with-temp-buffer