From e9d4e50c0a4de32115e8dd7e56a513116a52cbc5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 3 Jan 2018 14:29:51 -0500 Subject: [PATCH] Update core-ui tests --- core/test/core-ui.el | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/core/test/core-ui.el b/core/test/core-ui.el index c1c82a01d..9491628a7 100644 --- a/core/test/core-ui.el +++ b/core/test/core-ui.el @@ -3,18 +3,18 @@ (defmacro with-temp-windows!! (&rest body) (declare (indent defun)) - `(progn + `(cl-flet ((split-window (symbol-function #'split-window-horizontally))) (delete-other-windows) - (cl-flet ((split-window (symbol-function #'split-window-horizontally))) - (let ((a (get-buffer-create "a")) - (b (get-buffer-create "b")) - (split-width-threshold 0) - (window-min-width 0)) - ,@body)))) + (let ((a (get-buffer-create "a")) + (b (get-buffer-create "b")) + (split-width-threshold 0) + (window-min-width 0)) + ,@body))) ;; (def-test! set-mode-name - (let ((doom-major-mode-names '((text-mode . "abc") + (let ((after-change-major-mode-hook '(doom|set-mode-name)) + (doom-major-mode-names '((text-mode . "abc") (lisp-mode . (lambda () "xyz")) (js-mode . t)))) (text-mode) @@ -32,14 +32,3 @@ (should-not (kill-buffer)) (select-window (get-buffer-window b)) (should (kill-buffer))))) - -(def-test! *quit-window - (with-temp-windows!! - (let (kill-buffer-query-functions) - (switch-to-buffer a) (split-window) - (switch-to-buffer b) - (save-window-excursion - (quit-window t) - (should (buffer-live-p b))) - (quit-window) - (should-not (buffer-live-p b)))))