comparison tests/automated/mule-tests.el @ 4715:a357478dd457

Fix some test failures, mule-tests.el. 2009-10-12 Aidan Kehoe <kehoea@parhasard.net> * automated/mule-tests.el : Revert to the old Unicode mapping for scaron once we're finished testing it. Don't check the fixed-width coding systems with odd line endings for ASCII-transparency; maybe we should, but that would require that invalid sequence characters for on-disk ?\x0a be generated by Macintosh line-ending coding systems, for example.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 12 Oct 2009 17:01:15 +0100
parents 257b468bf2ca
children ad40dc9d3a97
comparison
equal deleted inserted replaced
4714:84f870bbd17b 4715:a357478dd457
425 ;;--------------------------------------------------------------- 425 ;;---------------------------------------------------------------
426 ;; Test Unicode-related functions 426 ;; Test Unicode-related functions
427 ;;--------------------------------------------------------------- 427 ;;---------------------------------------------------------------
428 (let* ((scaron (make-char 'latin-iso8859-2 57))) 428 (let* ((scaron (make-char 'latin-iso8859-2 57)))
429 ;; Used to try #x0000, but you can't change ASCII or Latin-1 429 ;; Used to try #x0000, but you can't change ASCII or Latin-1
430 (loop for code in '(#x0100 #x2222 #x4444 #xffff) do 430 (loop
431 for code in '(#x0100 #x2222 #x4444 #xffff)
432 with initial-unicode = (char-to-unicode scaron)
433 do
431 (progn 434 (progn
432 (set-unicode-conversion scaron code) 435 (set-unicode-conversion scaron code)
433 (Assert (eq code (char-to-unicode scaron))) 436 (Assert (eq code (char-to-unicode scaron)))
434 (Assert (eq scaron (unicode-to-char code '(latin-iso8859-2)))))) 437 (Assert (eq scaron (unicode-to-char code '(latin-iso8859-2)))))
435 438 finally (set-unicode-conversion scaron initial-unicode))
436 (Check-Error wrong-type-argument (set-unicode-conversion scaron -10000))) 439 (Check-Error wrong-type-argument (set-unicode-conversion scaron -10000)))
437 440
438 (dolist (utf-8-char 441 (dolist (utf-8-char
439 '("\xc6\x92" ;; U+0192 LATIN SMALL LETTER F WITH HOOK 442 '("\xc6\x92" ;; U+0192 LATIN SMALL LETTER F WITH HOOK
440 "\xe2\x81\x8a" ;; U+204A TIRONIAN SIGN ET 443 "\xe2\x81\x8a" ;; U+204A TIRONIAN SIGN ET
529 with all-possible-octets = (apply #'string 532 with all-possible-octets = (apply #'string
530 (loop for i from ?\x00 to ?\xFF 533 (loop for i from ?\x00 to ?\xFF
531 collect i)) 534 collect i))
532 do 535 do
533 (when (and (eq 'fixed-width (coding-system-type coding-system)) 536 (when (and (eq 'fixed-width (coding-system-type coding-system))
534 ;; Don't check the coding systems with autodetect, they are 537 ;; Don't check the coding systems with odd line endings
535 ;; not round-trip compatible for the possible line-ending 538 ;; (maybe we should):
536 ;; characters. 539 (eq 'lf (coding-system-eol-type coding-system)))
537 (string-match #r"-\(unix\|dos\|mac\)$"
538 (symbol-name coding-system)))
539 ;; These coding systems are round-trip compatible with themselves. 540 ;; These coding systems are round-trip compatible with themselves.
540 (Assert (equal (encode-coding-string 541 (Assert (equal (encode-coding-string
541 (decode-coding-string all-possible-octets 542 (decode-coding-string all-possible-octets
542 coding-system) 543 coding-system)
543 coding-system) 544 coding-system)
544 all-possible-octets)))) 545 all-possible-octets)
546 (format "checking %s is transparent" coding-system))))
545 547
546 ;;--------------------------------------------------------------- 548 ;;---------------------------------------------------------------
547 ;; Test charset-in-* functions 549 ;; Test charset-in-* functions
548 ;;--------------------------------------------------------------- 550 ;;---------------------------------------------------------------
549 (with-temp-buffer 551 (with-temp-buffer