From ff15b65e990fa40508666b00aa77ed9e5b73a881 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 14:43:20 -0500 Subject: 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%. --- tests/test-org-drill-small-branch-coverage.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- cgit v1.2.3