Update buffer api tests

+ Update for new real buffer spec
+ Remove coupling with core-popup
This commit is contained in:
Henrik Lissner 2018-01-03 19:59:48 -05:00
parent e9d4e50c0a
commit 87e1108f96
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -46,13 +46,12 @@
(def-test! real-buffers (def-test! real-buffers
(let (doom-real-buffer-functions) (let (doom-real-buffer-functions)
(with-temp-buffers!! (a b c d) (with-temp-buffers!! (a b c d)
(dolist (buf (list a b)) (with-current-buffer a
(with-current-buffer buf (setq-local buffer-file-name "x"))
(setq-local buffer-file-name "x"))) (with-current-buffer b
(setq-local doom-real-buffer-p t))
(with-current-buffer c (with-current-buffer c
(rename-buffer "*C*")) (rename-buffer "*C*"))
(with-current-buffer d
(doom-popup-mode +1))
(should (doom-real-buffer-p a)) (should (doom-real-buffer-p a))
(should (doom-real-buffer-p b)) (should (doom-real-buffer-p b))
(should-not (doom-real-buffer-p c)) (should-not (doom-real-buffer-p c))
@ -120,7 +119,9 @@
(switch-to-buffer a) (switch-to-buffer a)
(should (eq (current-buffer) a)) (should (eq (current-buffer) a))
(should (eq (selected-window) (get-buffer-window a))) (should (eq (selected-window) (get-buffer-window a)))
(should (kill-this-buffer)) (kill-this-buffer)
(should-not (eq (current-buffer) a))
(should-not (buffer-live-p a))
;; eventually end up in the fallback buffer ;; eventually end up in the fallback buffer
(let ((fallback (doom-fallback-buffer))) (let ((fallback (doom-fallback-buffer)))
(while (not (eq (current-buffer) fallback)) (while (not (eq (current-buffer) fallback))