diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/term-tests.el | 19 |
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." | |||
| 305 | `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y)) | 305 | `("\e[1;3r" "\e[2;1H" ,x "\r\e[1A" ,y)) |
| 306 | (concat y "\n" x))))) | 306 | (concat y "\n" x))))) |
| 307 | 307 | ||
| 308 | (ert-deftest term-decode-partial () ;; Bug#25288. | ||
| 309 | "Test multibyte characters sent into multiple chunks." | ||
| 310 | ;; Set `locale-coding-system' so test will be deterministic. | ||
| 311 | (let* ((locale-coding-system 'utf-8-unix) | ||
| 312 | (string (make-string 7 ?ш)) | ||
| 313 | (bytes (encode-coding-string string locale-coding-system))) | ||
| 314 | (should (equal string | ||
| 315 | (term-test-screen-from-input | ||
| 316 | 40 1 `(,(substring bytes 0 (/ (length bytes) 2)) | ||
| 317 | ,(substring bytes (/ (length bytes) 2)))))))) | ||
| 318 | (ert-deftest term-undecodable-input () ;; Bug#29918. | ||
| 319 | "Undecodable bytes should be passed through without error." | ||
| 320 | (let* ((locale-coding-system 'utf-8-unix) ; As above. | ||
| 321 | (bytes "\376\340\360\370") | ||
| 322 | (string (decode-coding-string bytes locale-coding-system))) | ||
| 323 | (should (equal string | ||
| 324 | (term-test-screen-from-input | ||
| 325 | 40 1 bytes))))) | ||
| 326 | |||
| 308 | (provide 'term-tests) | 327 | (provide 'term-tests) |
| 309 | 328 | ||
| 310 | ;;; term-tests.el ends here | 329 | ;;; term-tests.el ends here |