aboutsummaryrefslogtreecommitdiff
path: root/tests/testutil-ghostel-buffers.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testutil-ghostel-buffers.el')
-rw-r--r--tests/testutil-ghostel-buffers.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/testutil-ghostel-buffers.el b/tests/testutil-ghostel-buffers.el
index 52fb27e00..8e26efec4 100644
--- a/tests/testutil-ghostel-buffers.el
+++ b/tests/testutil-ghostel-buffers.el
@@ -45,5 +45,26 @@ ghostel-mode predicate without the side-effects of `(ghostel)'."
(setq-local major-mode 'ghostel-mode))
buf))
+(defun cj/test--make-fake-eat-buffer (name)
+ "Return a buffer named NAME with `major-mode' set to `eat-mode'.
+
+Avoids actually launching an EAT process by setting the mode buffer-locally.
+Used by the F12 toggle tests that need a buffer satisfying the eat-mode
+predicate without the side-effects of `(eat)'."
+ (let ((buf (get-buffer-create name)))
+ (with-current-buffer buf
+ (setq-local major-mode 'eat-mode))
+ buf))
+
+(defun cj/test--make-fake-eshell-buffer (name)
+ "Return a buffer named NAME with `major-mode' set to `eshell-mode'.
+
+Avoids starting a real eshell by setting the mode buffer-locally. Used by the
+F12 toggle tests that need a buffer satisfying the eshell-mode predicate."
+ (let ((buf (get-buffer-create name)))
+ (with-current-buffer buf
+ (setq-local major-mode 'eshell-mode))
+ buf))
+
(provide 'testutil-ghostel-buffers)
;;; testutil-ghostel-buffers.el ends here