1
0
Fork 0
emacs-config/test/oni-org-test.el

21 lines
866 B
EmacsLisp
Raw Permalink Normal View History

2020-01-14 08:17:38 +01:00
(require 'oni-org)
(ert-deftest oni-org-test-color-for ()
"Test that oni-org-color-for returns a hex color name."
(should (string= "#acbd18" (oni-org-color-for "foo"))))
(ert-deftest oni-org-test-generate-todo-keyword-faces ()
"Test that oni-org-generate-todo-keyword-faces returns a list of colors."
(let ((org-todo-keywords-1 '("foo" "bar")))
(should (equal (oni-org-generate-todo-keyword-faces)
'(("foo" . "#acbd18")
("bar" . "#37b51d"))))))
(ert-deftest oni-org-test-generate-tag-faces ()
"Test that oni-org-generate-tag-faces returns a list of colors."
(cl-letf (((symbol-function 'org-get-buffer-tags)
(lambda () '(("foo") ("bar")))))
(should (equal (oni-org-generate-tag-faces)
'(("foo" . "#acbd18")
("bar" . "#37b51d"))))))