branch: master commit 4836dd069b8d328f994810bd38962e917c274b00 Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> Commit: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com>
Add tests for prettifying symbols. --- context-coloring-test.el | 23 +++++++++++++++++++++++ fixtures/test/prettify-symbols.el | 1 + 2 files changed, 24 insertions(+) diff --git a/context-coloring-test.el b/context-coloring-test.el index ab77254..5ab7d60 100644 --- a/context-coloring-test.el +++ b/context-coloring-test.el @@ -344,6 +344,29 @@ signaled." '(context-coloring-level-0-face nil)) (disable-theme 'context-coloring-test-custom-theme))) +(defun context-coloring-test-assert-prettify-symbols-text-properties () + (unless (and (get-text-property 2 'prettify-symbols-start) + (get-text-property 2 'prettify-symbols-end)) + (ert-fail "Expected buffer to have it's symbols prettified, but it didn't."))) + +(context-coloring-test-deftest prettify-symbols-enabled-before + (lambda () + (context-coloring-test-with-fixture + "./fixtures/test/prettify-symbols.el" + (emacs-lisp-mode) + (prettify-symbols-mode) + (context-coloring-mode) + (context-coloring-test-assert-prettify-symbols-text-properties)))) + +(context-coloring-test-deftest prettify-symbols-enabled-after + (lambda () + (context-coloring-test-with-fixture + "./fixtures/test/prettify-symbols.el" + (emacs-lisp-mode) + (context-coloring-mode) + (prettify-symbols-mode) + (context-coloring-test-assert-prettify-symbols-text-properties)))) + ;;; Coloring tests diff --git a/fixtures/test/prettify-symbols.el b/fixtures/test/prettify-symbols.el new file mode 100644 index 0000000..52295a6 --- /dev/null +++ b/fixtures/test/prettify-symbols.el @@ -0,0 +1 @@ +(lambda ())