aboutsummaryrefslogtreecommitdiff
path: root/tests/test-org-drill-multicloze-dispatch.el
Commit message (Collapse)AuthorAgeFilesLines
* chore: coverage, autoload fix, and internal cleanup for org-drillCraig Jennings2026-05-261-0/+62
| | | | | | | | | | | | | | | | A batch of test-coverage and hardening work, squashed from the test-work branch. Tests: deduplicated a colliding leitner-capture test name so make test-name loads again. Added SM2 assert-failure cases, the six basic multicloze variant delegations, the three English-side spanish-verb branches, and org-drill-current-scope branch coverage. Fix: the entry-point commands (org-drill itself, cram-tree, tree, directory, resume, relearn-item, strip-all-data, merge-buffers) carried no autoload cookies, so M-x failed from a fresh install until something pulled the file in. They're autoloaded now. Perf: org-drill-shuffle was quadratic because it indexed a list with elt on every swap. It runs a linear Fisher-Yates pass over a vector now, and it checks its argument is a list. Feat: added org-drill-version, a constant plus an interactive command, so a bug reporter doesn't have to open the file header. Refactor: extracted org-drill--format-tense-mood, shared by the two verb-conjugation presenters that each carried a copy. Docs: explained the SM8 magic numbers in the simple8 helpers as empirical fits rather than tunable knobs.
* test: add multicloze weighted-presenter dispatch coverageCraig Jennings2026-05-051-0/+143
8 ERT tests covering hide1-firstmore, show1-lastmore, show1-firstless. Each wraps a cond that selects between common and uncommon multicloze presenters based on org-drill-cloze-text-weight and the entry's total-repeats counter. Underlying presenter functions are mocked to no-op stubs that record which one was selected — the branch logic is what's under test, not the (interactive) cloze-prompt itself. Cases covered per function: - nil weight → fall back to non-weighted variant - invalid weight (non-positive int) → error - non-trigger rep → common path (hide-first / show-last / skip-first) - trigger rep → uncommon path (hide-n with appropriate force flags)