diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-26 19:58:21 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-26 19:58:21 -0500 |
| commit | 7eece407772d7c5cfba93ba914439094f0d9fbf2 (patch) | |
| tree | 4b25307c895ab134312cd31141c48c0aea3c530e /tests/test-org-drill-custom-groups.el | |
| parent | 5c8d908a943470e3e4738c090cf8eaa1deee5a1f (diff) | |
| download | org-drill-7eece407772d7c5cfba93ba914439094f0d9fbf2.tar.gz org-drill-7eece407772d7c5cfba93ba914439094f0d9fbf2.zip | |
refactor: dedupe presenters, group defcustoms, and fill in docstrings
A cleanup pass over org-drill internals, squashed from the refactor/wave3-cleanup branch. No behavior change. Each step kept the existing tests green and added its own.
I shared two duplicated helpers across the language card getters: org-drill--read-property-string and org-drill--face-from-alist.
I factored the cloze body-scan out of the two multicloze presenters into org-drill--cloze-body-bounds, org-drill--count-cloze-matches, and org-drill--hide-cloze-by-index, so each presenter just picks which indices to hide.
I pulled the presenter resolution and the four-way result classification out of org-drill-entry-f into org-drill--resolve-presenter and org-drill--classify-presentation-result, untangling the pivot of every drill iteration.
I split the 37 defcustoms (and the three cloze faces) into four customize sub-groups (display, algorithm, session, leech) so customize-group org-drill is navigable. There's no leitner group because the Leitner settings are defvars.
I documented the 22 defuns that had no docstring, rewrote the corrupted org-drill-presentation-prompt-in-mini-buffer docstring, and switched eleven docstrings to the imperative "Return" (issue #2).
Diffstat (limited to 'tests/test-org-drill-custom-groups.el')
| -rw-r--r-- | tests/test-org-drill-custom-groups.el | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test-org-drill-custom-groups.el b/tests/test-org-drill-custom-groups.el new file mode 100644 index 0000000..fe1e22c --- /dev/null +++ b/tests/test-org-drill-custom-groups.el @@ -0,0 +1,37 @@ +;;; test-org-drill-custom-groups.el --- Customize sub-group structure -*- lexical-binding: t; -*- + +;;; Commentary: +;; The defcustoms are split across four sub-groups under the top-level +;; org-drill group so M-x customize-group org-drill is navigable instead of +;; dumping 37 options in one flat list. (There is no leitner sub-group: the +;; Leitner settings are defvars, not defcustoms.) + +;;; Code: + +(require 'ert) +(require 'org-drill) + +(defconst test-org-drill-subgroups + '(org-drill-display org-drill-algorithm org-drill-session org-drill-leech) + "The customize sub-groups org-drill defines.") + +(ert-deftest test-org-drill-subgroups-exist-and-nest-under-org-drill () + "Each sub-group is defined and is a child of the org-drill group." + (dolist (g test-org-drill-subgroups) + (should (get g 'group-documentation)) + (should (assq g (get 'org-drill 'custom-group))))) + +(ert-deftest test-org-drill-defcustoms-land-in-expected-subgroups () + "A representative defcustom from each sub-group is a member of it." + (should (assq 'org-drill-spaced-repetition-algorithm + (get 'org-drill-algorithm 'custom-group))) + (should (assq 'org-drill-leech-method + (get 'org-drill-leech 'custom-group))) + (should (assq 'org-drill-scope + (get 'org-drill-session 'custom-group))) + (should (assq 'org-drill-use-visible-cloze-face-p + (get 'org-drill-display 'custom-group)))) + +(provide 'test-org-drill-custom-groups) + +;;; test-org-drill-custom-groups.el ends here |
