diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/keymap-tests.el | 12 | ||||
| -rw-r--r-- | test/src/process-tests.el | 23 |
2 files changed, 33 insertions, 2 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 74fb3c892db..d4f5fc3f190 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el | |||
| @@ -248,6 +248,18 @@ g .. h foo | |||
| 248 | 0 .. 3 foo | 248 | 0 .. 3 foo |
| 249 | "))))) | 249 | "))))) |
| 250 | 250 | ||
| 251 | (ert-deftest keymap--key-description () | ||
| 252 | (should (equal (key-description [right] [?\C-x]) | ||
| 253 | "C-x <right>")) | ||
| 254 | (should (equal (key-description [M-H-right] [?\C-x]) | ||
| 255 | "C-x M-H-<right>")) | ||
| 256 | (should (equal (single-key-description 'home) | ||
| 257 | "<home>")) | ||
| 258 | (should (equal (single-key-description 'home t) | ||
| 259 | "home")) | ||
| 260 | (should (equal (single-key-description 'C-s-home) | ||
| 261 | "C-s-<home>"))) | ||
| 262 | |||
| 251 | (provide 'keymap-tests) | 263 | (provide 'keymap-tests) |
| 252 | 264 | ||
| 253 | ;;; keymap-tests.el ends here | 265 | ;;; keymap-tests.el ends here |
diff --git a/test/src/process-tests.el b/test/src/process-tests.el index 5294bc07ce5..921bcd5f85b 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el | |||
| @@ -560,8 +560,16 @@ FD_SETSIZE file descriptors (Bug#24325)." | |||
| 560 | ;; We should have managed to start at least one process. | 560 | ;; We should have managed to start at least one process. |
| 561 | (should processes) | 561 | (should processes) |
| 562 | (dolist (process processes) | 562 | (dolist (process processes) |
| 563 | (should (process-live-p process)) | 563 | ;; The process now should either be running, or have |
| 564 | (process-send-eof process) | 564 | ;; already failed before `exec'. |
| 565 | (should (memq (process-status process) '(run exit))) | ||
| 566 | (when (process-live-p process) | ||
| 567 | (process-send-eof process)) | ||
| 568 | ;; FIXME: This `sleep-for' shouldn't be needed. It | ||
| 569 | ;; indicates a bug in Emacs; perhaps SIGCHLD is | ||
| 570 | ;; received in parallel with `accept-process-output', | ||
| 571 | ;; causing the latter to hang. | ||
| 572 | (sleep-for 0.1) | ||
| 565 | (while (accept-process-output process)) | 573 | (while (accept-process-output process)) |
| 566 | (should (eq (process-status process) 'exit)) | 574 | (should (eq (process-status process) 'exit)) |
| 567 | ;; If there's an error between fork and exec, Emacs | 575 | ;; If there's an error between fork and exec, Emacs |
| @@ -643,6 +651,8 @@ FD_SETSIZE file descriptors (Bug#24325)." | |||
| 643 | (ert-deftest process-tests/fd-setsize-no-crash/make-serial-process () | 651 | (ert-deftest process-tests/fd-setsize-no-crash/make-serial-process () |
| 644 | "Check that Emacs doesn't crash when trying to use more than | 652 | "Check that Emacs doesn't crash when trying to use more than |
| 645 | FD_SETSIZE file descriptors (Bug#24325)." | 653 | FD_SETSIZE file descriptors (Bug#24325)." |
| 654 | ;; This test cannot be run if PTYs aren't supported. | ||
| 655 | (skip-unless (not (eq system-type 'windows-nt))) | ||
| 646 | (with-timeout (60 (ert-fail "Test timed out")) | 656 | (with-timeout (60 (ert-fail "Test timed out")) |
| 647 | (process-tests--with-processes processes | 657 | (process-tests--with-processes processes |
| 648 | ;; In order to use `make-serial-process', we need to create some | 658 | ;; In order to use `make-serial-process', we need to create some |
| @@ -664,6 +674,15 @@ FD_SETSIZE file descriptors (Bug#24325)." | |||
| 664 | (tty-name (process-tty-name host))) | 674 | (tty-name (process-tty-name host))) |
| 665 | (should (processp host)) | 675 | (should (processp host)) |
| 666 | (push host processes) | 676 | (push host processes) |
| 677 | ;; FIXME: The assumption below that using :connection 'pty | ||
| 678 | ;; in make-process necessarily produces a process with PTY | ||
| 679 | ;; connection is unreliable and non-portable. | ||
| 680 | ;; make-process can legitimately and silently fall back on | ||
| 681 | ;; pipes if allocating a PTY fails (and on MS-Windows it | ||
| 682 | ;; always fails). The following code also assumes that | ||
| 683 | ;; process-tty-name produces a file name that can be | ||
| 684 | ;; passed to 'stat' and to make-serial-process, which is | ||
| 685 | ;; also non-portable. | ||
| 667 | (should tty-name) | 686 | (should tty-name) |
| 668 | (should (file-exists-p tty-name)) | 687 | (should (file-exists-p tty-name)) |
| 669 | (should-not (member tty-name tty-names)) | 688 | (should-not (member tty-name tty-names)) |