summaryrefslogtreecommitdiff
path: root/test/lisp/term-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2019-07-20 22:02:36 -0400
committerNoam Postavsky <npostavs@gmail.com>2019-07-20 22:02:36 -0400
commit6490269becdad96ca4b3b9db0d96dbb04ef2ab6a (patch)
tree20cccad69113acfe3072dcf50a677b06c6d7b4fb /test/lisp/term-tests.el
parentf02b9e9a6ff701d041ef86afe8b9a92ba8e4fd30 (diff)
parent150bdfe43acde8423612cbff4eafbbb88878b497 (diff)
downloademacs-6490269becdad96ca4b3b9db0d96dbb04ef2ab6a.tar.gz
Merge from emacs-26
150bdfe43a Handle completely undecoded input in term (Bug#29918) 021f32cca1 * doc/misc/forms.texi (Control File Format): Fix a doc error. 76538d09b7 Fix typo in package-alist docstring b2fde4b5e8 * doc/lispref/text.texi (Mode-Specific Indent): Fix a typo... 7e62778548 ; Another minor change in 'bidi-display-reordering's doc s... 4455ddbe56 Improve doc string of 'bidi-display-reordering' 34ee26dd93 Add warning to bidi-display-reordering doc string # Conflicts: # lisp/term.el # test/lisp/term-tests.el
Diffstat (limited to 'test/lisp/term-tests.el')
-rw-r--r--test/lisp/term-tests.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 33ed006cf8b..5fca002f07c 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -305,6 +305,25 @@ This is a reduced example from GNU nano's initial screen."
`("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y))
(concat y "\n" x)))))
+(ert-deftest term-decode-partial () ;; Bug#25288.
+ "Test multibyte characters sent into multiple chunks."
+ ;; Set `locale-coding-system' so test will be deterministic.
+ (let* ((locale-coding-system 'utf-8-unix)
+ (string (make-string 7 ?ш))
+ (bytes (encode-coding-string string locale-coding-system)))
+ (should (equal string
+ (term-test-screen-from-input
+ 40 1 `(,(substring bytes 0 (/ (length bytes) 2))
+ ,(substring bytes (/ (length bytes) 2))))))))
+(ert-deftest term-undecodable-input () ;; Bug#29918.
+ "Undecodable bytes should be passed through without error."
+ (let* ((locale-coding-system 'utf-8-unix) ; As above.
+ (bytes "\376\340\360\370")
+ (string (decode-coding-string bytes locale-coding-system)))
+ (should (equal string
+ (term-test-screen-from-input
+ 40 1 bytes)))))
+
(provide 'term-tests)
;;; term-tests.el ends here