aboutsummaryrefslogtreecommitdiff
path: root/tests/test-org-drill-orchestration-helpers.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 14:19:09 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 14:19:09 -0500
commitc159b236b8fe4dc0b2454475c2ca3f699e42ab07 (patch)
tree2338f614f491a62c8d2e7e4e1dac71826ccbca46 /tests/test-org-drill-orchestration-helpers.el
parent657f494c2ae157fe11bcab1fab0d787dc1fa9752 (diff)
downloadorg-drill-c159b236b8fe4dc0b2454475c2ca3f699e42ab07.tar.gz
org-drill-c159b236b8fe4dc0b2454475c2ca3f699e42ab07.zip
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%.
Diffstat (limited to 'tests/test-org-drill-orchestration-helpers.el')
-rw-r--r--tests/test-org-drill-orchestration-helpers.el22
1 files changed, 22 insertions, 0 deletions
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 ()