# HG changeset patch # User Stephen J. Turnbull # Date 1267889538 -32400 # Node ID ae4ddcdf30c016cedf86a1f6e851c6ffb83f611d # Parent d76a51b29d913a7cc31d2dc7600717628dec63f6 Test escape-quoted for the range U+0000 to U+00FF. * automated/mule-tests.el (string character conversion): Inspired by Ben's patch to fix quoting of specials from C1 controls. diff -r d76a51b29d91 -r ae4ddcdf30c0 tests/ChangeLog --- a/tests/ChangeLog Sat Mar 06 00:01:04 2010 -0600 +++ b/tests/ChangeLog Sun Mar 07 00:32:18 2010 +0900 @@ -1,3 +1,9 @@ +2010-03-07 Stephen J. Turnbull + + * automated/mule-tests.el (string character conversion): + Test escape-quoted for the range U+0000 to U+00FF. + Inspired by Ben's patch to fix quoting of specials from C1 controls. + 2010-02-22 Ben Wing * automated/syntax-tests.el: diff -r d76a51b29d91 -r ae4ddcdf30c0 tests/automated/mule-tests.el --- a/tests/automated/mule-tests.el Sat Mar 06 00:01:04 2010 -0600 +++ b/tests/automated/mule-tests.el Sun Mar 07 00:32:18 2010 +0900 @@ -375,6 +375,29 @@ (Assert-equal (substring string (* 94 k) (* 94 (1+ k))) ascii-string))) ;;--------------------------------------------------------------- + ;; Test string character conversion + ;;--------------------------------------------------------------- + + ;; #### This should test all coding systems! + + (let ((all-octets (let ((s (make-string 256 ?\000))) + (loop for i from (1- (length s)) downto 0 do + (aset s i (int-char i))) + s)) + (escape-quoted-result (let ((schar '(27 155 142 143 14 15)) + (s (make-string 262 ?\000)) + (pos 0)) + (loop for ord from 0 to 255 do + (when (member ord schar) + (aset s pos ?\033) + (incf pos)) + (aset s pos (int-char ord)) + (incf pos)) + s))) + (Assert (string= (encode-coding-string all-octets 'escape-quoted) + escape-quoted-result))) + + ;;--------------------------------------------------------------- ;; Test file-system character conversion (and, en passant, file ops) ;;--------------------------------------------------------------- (let* ((dstroke (make-char 'latin-iso8859-2 80))