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

20 lines
866 B
EmacsLisp
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(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"))))))