summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-02-02 18:12:00 -0500
committerNoam Postavsky <npostavs@gmail.com>2018-02-02 18:12:37 -0500
commit2b288eb9006ed897e7323212408bd25b4bfe2230 (patch)
tree841a0b11e1ba1a3139b52b30e1a21c76a73c0247 /test
parentd3090a3a3e22c4b0f4e0e833942f5942eb392c51 (diff)
parent4c8157cfe06ef5715ba8533be164dd9a047711d0 (diff)
downloademacs-2b288eb9006ed897e7323212408bd25b4bfe2230.tar.gz
; Merge from emacs-26
4c8157cfe0 ; Let files-tests.el pass multiple times in a session 99251ab62e ; Avoid process kill query during term tests
Diffstat (limited to 'test')
-rw-r--r--test/lisp/files-tests.el22
-rw-r--r--test/lisp/term-tests.el22
2 files changed, 17 insertions, 27 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 90e5ebf2153..5f42b904cca 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -139,18 +139,16 @@ form.")
(ert-deftest files-test-local-variables ()
"Test the file-local variables implementation."
- (unwind-protect
- (progn
- (defadvice hack-local-variables-confirm (around files-test activate)
- (setq files-test-result 'query)
- nil)
- (dolist (test files-test-local-variable-data)
- (let ((str (concat "text\n\n;; Local Variables:\n;; "
- (mapconcat 'identity (car test) "\n;; ")
- "\n;; End:\n")))
- (dolist (subtest (cdr test))
- (should (file-test--do-local-variables-test str subtest))))))
- (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test)))
+ (cl-letf (((symbol-function 'hack-local-variables-confirm)
+ (lambda (&rest _)
+ (setq files-test-result 'query)
+ nil)))
+ (dolist (test files-test-local-variable-data)
+ (let ((str (concat "text\n\n;; Local Variables:\n;; "
+ (mapconcat 'identity (car test) "\n;; ")
+ "\n;; End:\n")))
+ (dolist (subtest (cdr test))
+ (should (file-test--do-local-variables-test str subtest)))))))
(defvar files-test-bug-18141-file
(expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY"))
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 16466ea3cd4..234dfa1f0d5 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -42,21 +42,13 @@
;; control chunking, and we don't have to worry about wrestling
;; with stty settings.
(let ((proc (get-buffer-process (current-buffer))))
- (unwind-protect
- (prog2 (if (consp input)
- (mapc (lambda (input) (term-emulate-terminal proc input)) input)
- (term-emulate-terminal proc input))
- (if return-var (buffer-local-value return-var (current-buffer))
- (buffer-substring-no-properties (point-min) (point-max)))
- ;; End the process to avoid query on buffer kill.
- (process-send-eof proc)
- (accept-process-output proc))
- ;; Make extra sure we don't get stuck in case we hit some
- ;; error before sending eof.
- (when (process-live-p proc)
- (kill-process proc)
- ;; Let Emacs update process status.
- (accept-process-output proc))))))
+ ;; Don't get stuck when we close the buffer.
+ (set-process-query-on-exit-flag proc nil)
+ (if (consp input)
+ (mapc (lambda (input) (term-emulate-terminal proc input)) input)
+ (term-emulate-terminal proc input))
+ (if return-var (buffer-local-value return-var (current-buffer))
+ (buffer-substring-no-properties (point-min) (point-max))))))
(ert-deftest term-simple-lines ()
(let ((str "\