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

@ -147,10 +147,13 @@
;; --- Settings ---------------------------
(def-setting! :-test-setting (x) x)
(def-test! set
(should (assq :-test-setting doom-settings))
(should (set! :-test-setting t))
(let ((inhibit-message t))
(should-not (set! :non-existant-setting (error "This shouldn't trigger")))))
(eval-and-compile
(let (doom-settings)
(def-setting! :-test-setting (x) `(setq result ,x))
(should (assq :-test-setting doom-settings))
(let ((inhibit-message t)
result)
(set! :-test-setting t)
(should result)
(set! :non-existant-setting (error "This shouldn't trigger"))))))