From 1338b2ae757b7143fe4d211fc5a354c73cee526b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 26 May 2026 18:09:21 -0500 Subject: chore: coverage, autoload fix, and internal cleanup for org-drill 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. --- tests/test-org-drill-language-presenters.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/test-org-drill-language-presenters.el') diff --git a/tests/test-org-drill-language-presenters.el b/tests/test-org-drill-language-presenters.el index 6375b5f..da0a3a8 100644 --- a/tests/test-org-drill-language-presenters.el +++ b/tests/test-org-drill-language-presenters.el @@ -154,6 +154,25 @@ (lambda (_) (setq reschedule-called t)))) (should reschedule-called)))) +;;;; org-drill--format-tense-mood + +(ert-deftest test-org-drill-format-tense-mood-both () + "With both tense and mood, the label names both." + (should (equal "past tense, subjunctive mood" + (org-drill--format-tense-mood "past" "subjunctive")))) + +(ert-deftest test-org-drill-format-tense-mood-tense-only () + "With only a tense, the label names the tense." + (should (equal "present tense" (org-drill--format-tense-mood "present" nil)))) + +(ert-deftest test-org-drill-format-tense-mood-mood-only () + "With only a mood, the label names the mood." + (should (equal "imperative mood" (org-drill--format-tense-mood nil "imperative")))) + +(ert-deftest test-org-drill-format-tense-mood-neither-is-nil () + "With neither tense nor mood, there is no label." + (should (null (org-drill--format-tense-mood nil nil)))) + (provide 'test-org-drill-language-presenters) ;;; test-org-drill-language-presenters.el ends here -- cgit v1.2.3