Update core-ui tests

This commit is contained in:
Henrik Lissner 2018-01-03 14:29:51 -05:00
parent 93f3f0ef38
commit e9d4e50c0a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -3,18 +3,18 @@
(defmacro with-temp-windows!! (&rest body) (defmacro with-temp-windows!! (&rest body)
(declare (indent defun)) (declare (indent defun))
`(progn `(cl-flet ((split-window (symbol-function #'split-window-horizontally)))
(delete-other-windows) (delete-other-windows)
(cl-flet ((split-window (symbol-function #'split-window-horizontally))) (let ((a (get-buffer-create "a"))
(let ((a (get-buffer-create "a")) (b (get-buffer-create "b"))
(b (get-buffer-create "b")) (split-width-threshold 0)
(split-width-threshold 0) (window-min-width 0))
(window-min-width 0)) ,@body)))
,@body))))
;; ;;
(def-test! set-mode-name (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")) (lisp-mode . (lambda () "xyz"))
(js-mode . t)))) (js-mode . t))))
(text-mode) (text-mode)
@ -32,14 +32,3 @@
(should-not (kill-buffer)) (should-not (kill-buffer))
(select-window (get-buffer-window b)) (select-window (get-buffer-window b))
(should (kill-buffer))))) (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)))))