Refactor and fix unit tests, plus isolate them better

This commit is contained in:
Henrik Lissner 2017-12-31 11:45:02 -05:00
parent 5c74814860
commit 8ad2666f8f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
14 changed files with 146 additions and 117 deletions

View file

@ -2,18 +2,16 @@
;;; core/test/autoload-debug.el
(def-test! what-face
(with-temp-buffer
(insert (propertize "Hello " 'face 'font-lock-keyword-face))
(insert "world")
(insert (propertize "Hello " 'face 'font-lock-keyword-face))
(insert "world")
(should (equal (doom/what-face (point-min)) '((font-lock-keyword-face) ())))
(should-not (doom/what-face (point-max)))))
(should (equal (doom/what-face (point-min)) '((font-lock-keyword-face) ())))
(should-not (doom/what-face (point-max))))
(def-test! what-face-overlays
(with-temp-buffer
(insert "Hello world")
(let ((ov (make-overlay 1 6)))
(overlay-put ov 'face 'font-lock-keyword-face))
(insert "Hello world")
(let ((ov (make-overlay 1 6)))
(overlay-put ov 'face 'font-lock-keyword-face))
(should (equal (doom/what-face (point-min)) '(() (font-lock-keyword-face))))
(should-not (doom/what-face (point-max)))))
(should (equal (doom/what-face (point-min)) '(() (font-lock-keyword-face))))
(should-not (doom/what-face (point-max))))