aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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 c2b90dea604..237e19d6b15 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -144,6 +144,25 @@ This is a reduced example from GNU nano's initial screen."
144 `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y)) 144 `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y))
145 (concat y "\n" x))))) 145 (concat y "\n" x)))))
146 146
147(ert-deftest term-decode-partial () ;; Bug#25288.
148 "Test multibyte characters sent into multiple chunks."
149 ;; Set `locale-coding-system' so test will be deterministic.
150 (let* ((locale-coding-system 'utf-8-unix)
151 (string (make-string 7 ?ш))
152 (bytes (encode-coding-string string locale-coding-system)))
153 (should (equal string
154 (term-test-screen-from-input
155 40 1 `(,(substring bytes 0 (/ (length bytes) 2))
156 ,(substring bytes (/ (length bytes) 2))))))))
157
158(ert-deftest term-undecodable-input () ;; Bug#29918.
159 "Undecodable bytes should be passed through without error."
160 (let* ((locale-coding-system 'utf-8-unix) ; As above.
161 (bytes "\376\340\360\370")
162 (string (decode-coding-string bytes locale-coding-system)))
163 (should (equal string
164 (term-test-screen-from-input
165 40 1 bytes)))))
147 166
148(provide 'term-tests) 167(provide 'term-tests)
149 168