From c267cd01517bca9570faf13c4454793e7fb0c97b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Tue, 3 Jan 2023 23:10:53 -0800 Subject: [PATCH] ; Kill some stray buffers left behind by ERC tests * test/lisp/erc/erc-services-tests.el (erc--auth-source-search--plstore-standard, erc--auth-source-search--plstore-announced, erc--auth-source-search--plstore-overrides): Kill buffer renamed by plstore. In the future, try using the `:buffer' keyword introduced in Emacs 29. * test/lisp/erc/resources/erc-d/erc-d-t.el (erc-d-t-kill-related-buffers): Don't forget about `erc-dcc-chat-mode' buffers. --- test/lisp/erc/erc-services-tests.el | 9 ++++++--- test/lisp/erc/resources/erc-d/erc-d-t.el | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/lisp/erc/erc-services-tests.el b/test/lisp/erc/erc-services-tests.el index b1d36d868eb..9181a47ee3b 100644 --- a/test/lisp/erc/erc-services-tests.el +++ b/test/lisp/erc/erc-services-tests.el @@ -248,7 +248,8 @@ (let ((auth-sources (list plstore-file)) (auth-source-do-cache nil)) (erc-services-tests--auth-source-standard - #'erc-services-test--call-with-plstore)))) + #'erc-services-test--call-with-plstore)) + (kill-buffer (get-file-buffer plstore-file)))) (ert-deftest erc--auth-source-search--plstore-announced () (ert-with-temp-file plstore-file @@ -264,7 +265,8 @@ (let ((auth-sources (list plstore-file)) (auth-source-do-cache nil)) (erc-services-tests--auth-source-announced - #'erc-services-test--call-with-plstore)))) + #'erc-services-test--call-with-plstore)) + (kill-buffer (get-file-buffer plstore-file)))) (ert-deftest erc--auth-source-search--plstore-overrides () (ert-with-temp-file plstore-file @@ -296,7 +298,8 @@ (let ((auth-sources (list plstore-file)) (auth-source-do-cache nil)) (erc-services-tests--auth-source-overrides - #'erc-services-test--call-with-plstore)))) + #'erc-services-test--call-with-plstore)) + (kill-buffer (get-file-buffer plstore-file)))) ;; auth-source JSON backend diff --git a/test/lisp/erc/resources/erc-d/erc-d-t.el b/test/lisp/erc/resources/erc-d/erc-d-t.el index 282c193b707..7b2adf4f07b 100644 --- a/test/lisp/erc/resources/erc-d/erc-d-t.el +++ b/test/lisp/erc/resources/erc-d/erc-d-t.el @@ -32,7 +32,7 @@ (dolist (buf (buffer-list)) (with-current-buffer buf (when (or erc-d-u--process-buffer - (derived-mode-p 'erc-mode)) + (derived-mode-p 'erc-mode 'erc-dcc-chat-mode)) (push buf buflist)))) (dolist (buf buflist) (when (and (boundp 'erc-server-flood-timer) -- 2.39.5