diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 14:43:20 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 14:43:20 -0500 |
| commit | ff15b65e990fa40508666b00aa77ed9e5b73a881 (patch) | |
| tree | bc5b6a26a20e6677caf84ac142703c2dafe113ed /tests | |
| parent | b6dff95157772e97610fc79aa7166ad1be3abf67 (diff) | |
| download | org-drill-ff15b65e990fa40508666b00aa77ed9e5b73a881.tar.gz org-drill-ff15b65e990fa40508666b00aa77ed9e5b73a881.zip | |
test: cover org-drill-add-cloze-fontification flag branch
I added a couple of cases for `org-drill-add-cloze-fontification':
when `org-drill-use-visible-cloze-face-p' is t, a fontification spec
gets pushed onto `org-font-lock-extra-keywords'; with the flag nil,
the list is left alone.
Coverage moved from 92.1% to 92.3%.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-org-drill-small-branch-coverage.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test-org-drill-small-branch-coverage.el b/tests/test-org-drill-small-branch-coverage.el index 20e52d6..4e50f3d 100644 --- a/tests/test-org-drill-small-branch-coverage.el +++ b/tests/test-org-drill-small-branch-coverage.el @@ -75,5 +75,24 @@ read and re-activates it on the way out." ((symbol-function 'org-drill-entry-p) (lambda (&rest _) nil))) (should-error (org-drill-goto-drill-entry-heading))))) +;;;; org-drill-add-cloze-fontification + +(ert-deftest test-add-cloze-fontification-with-flag-extends-keywords () + "When `org-drill-use-visible-cloze-face-p' is t, the cloze keyword spec is +added to `org-font-lock-extra-keywords'." + (with-temp-buffer + (let ((org-drill-use-visible-cloze-face-p t) + (org-font-lock-extra-keywords nil)) + (org-drill-add-cloze-fontification) + (should org-font-lock-extra-keywords)))) + +(ert-deftest test-add-cloze-fontification-without-flag-leaves-keywords-untouched () + "When the flag is nil, no entry is added to `org-font-lock-extra-keywords'." + (with-temp-buffer + (let ((org-drill-use-visible-cloze-face-p nil) + (org-font-lock-extra-keywords nil)) + (org-drill-add-cloze-fontification) + (should (null org-font-lock-extra-keywords))))) + (provide 'test-org-drill-small-branch-coverage) ;;; test-org-drill-small-branch-coverage.el ends here |
