From c159b236b8fe4dc0b2454475c2ca3f699e42ab07 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 14:19:09 -0500 Subject: test: cover marker end-pos, variable-pitch restore, young/overdue queue branches I extended three existing test files with cases that hit branches the suite was missing: `org-drill--show-end-message' with a live-marker end-pos (jumps to the marker), `org-drill--restore-display' for the variable-pitch-on / variable-pitch-off / text-scale paths, and `org-drill-pop-next-pending-entry' for the young-mature and overdue branches in the queue priority cond. Coverage moved from 87.0% to 87.8%. --- tests/test-org-drill-orchestration-helpers.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/test-org-drill-orchestration-helpers.el') diff --git a/tests/test-org-drill-orchestration-helpers.el b/tests/test-org-drill-orchestration-helpers.el index 920487c..5589fa7 100644 --- a/tests/test-org-drill-orchestration-helpers.el +++ b/tests/test-org-drill-orchestration-helpers.el @@ -153,6 +153,28 @@ (should final-report-shown) (should-not resume-hint-shown)))) +(ert-deftest test-show-end-message-marker-end-pos-jumps-to-marker () + "When end-pos is a live marker, dispatcher navigates to it before showing +the resume hint." + (let ((tmpfile (make-temp-file "org-drill-end-pos-" nil ".org"))) + (unwind-protect + (let ((session (org-drill-session)) + (jumped-to nil)) + (with-current-buffer (find-file-noselect tmpfile) + (insert "* First :drill:\n* Second :drill:\nbody\n") + (org-mode) + (goto-char (point-max)) + (let ((m (point-marker))) + (oset session end-pos m) + (cl-letf (((symbol-function 'org-drill-goto-entry) + (lambda (mk) (setq jumped-to mk))) + ((symbol-function 'org-reveal) #'ignore) + ((symbol-function 'org-fold-show-entry) #'ignore) + ((symbol-function 'org-drill--show-resume-hint) #'ignore)) + (org-drill--show-end-message session) + (should (eq jumped-to m)))))) + (when (file-exists-p tmpfile) (delete-file tmpfile))))) + ;;;; org-drill--build-dest-id-table (ert-deftest test-build-dest-id-table-populates-id-marker-pairs () -- cgit v1.2.3