]> code.delx.au - gnu-emacs/commitdiff
Added tests for dos unibyte decoding.
authorAndrew Hyatt <ahyatt@gmail.com>
Sat, 21 May 2016 04:08:27 +0000 (00:08 -0400)
committerAndrew Hyatt <ahyatt@gmail.com>
Sat, 21 May 2016 04:13:43 +0000 (00:13 -0400)
The underlying bug was previously fixed by Eli Zaretskii in commit
c8109d9c4057d8cac79e2c139758cadd410e7446.

test/lisp/legacy/coding-tests.el

index cba8c7bc25f00283989d9965de6a2f9e61753b4c..772c8735519b87b1c5de68f3078a4fff82743f62 100644 (file)
          (let ((coding-system-for-write (intern "\"us-ascii\"")))
            (write-region "some text" nil test-file))))
     (coding-tests-remove-files)))
+
+;; See issue #5251.
+(ert-deftest ert-test-unibyte-buffer-dos-eol-decode ()
+  (with-temp-buffer
+    (set-buffer-multibyte nil)
+    (insert (encode-coding-string "あ" 'euc-jp) "\xd" "\n")
+    (decode-coding-region (point-min) (point-max) 'euc-jp-dos)
+    (should-not (string-match-p "\^M" (buffer-string)))))