From ac734cfd3208cb3d50c24ff1eb371c75fe71d59c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 14:28:01 -0500 Subject: test: cover the org-drill main entry and hypothetical-next-review-date dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I added tests for the public `org-drill' command that mock `org-drill-entries' so the orchestrator runs in batch: empty buffer → 'no pending' message, populated buffer → entry loop runs, cram=t flag flips the session's cram-mode slot, resume-p skips entry collection. I also extended the cloze + scheduling helpers file with sm2 and simple8 coverage for `org-drill-hypothetical-next-review-date'. Coverage moved from 89.0% to 89.8%. --- tests/test-org-drill-cloze-and-scheduling-helpers.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test-org-drill-cloze-and-scheduling-helpers.el') diff --git a/tests/test-org-drill-cloze-and-scheduling-helpers.el b/tests/test-org-drill-cloze-and-scheduling-helpers.el index ba6503c..1ee4c61 100644 --- a/tests/test-org-drill-cloze-and-scheduling-helpers.el +++ b/tests/test-org-drill-cloze-and-scheduling-helpers.el @@ -115,6 +115,22 @@ symbol itself." (should (equal 0 (org-drill-hypothetical-next-review-date 1))) (should (equal 0 (org-drill-hypothetical-next-review-date 2))))) +(ert-deftest test-org-drill-hypothetical-next-review-date-sm2-algorithm () + "With sm2 selected, hypothetical-next-review-date returns a positive number." + (with-fresh-drill-entry + (let ((org-drill-spaced-repetition-algorithm 'sm2)) + (let ((days (org-drill-hypothetical-next-review-date 5))) + (should (numberp days)) + (should (>= days 0)))))) + +(ert-deftest test-org-drill-hypothetical-next-review-date-simple8-algorithm () + "With simple8 selected, hypothetical-next-review-date returns a positive number." + (with-fresh-drill-entry + (let ((org-drill-spaced-repetition-algorithm 'simple8)) + (let ((days (org-drill-hypothetical-next-review-date 5))) + (should (numberp days)) + (should (>= days 0)))))) + (ert-deftest test-org-drill-hypothetical-next-review-date-quality-monotonic () "Higher quality means longer next-interval — the curve should be monotonic non-decreasing across q=3 → q=5 on a virgin card." -- cgit v1.2.3