diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 14:19:09 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 14:19:09 -0500 |
| commit | c159b236b8fe4dc0b2454475c2ca3f699e42ab07 (patch) | |
| tree | 2338f614f491a62c8d2e7e4e1dac71826ccbca46 /tests/test-org-drill-queue-and-misc.el | |
| parent | 657f494c2ae157fe11bcab1fab0d787dc1fa9752 (diff) | |
| download | org-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-queue-and-misc.el')
| -rw-r--r-- | tests/test-org-drill-queue-and-misc.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test-org-drill-queue-and-misc.el b/tests/test-org-drill-queue-and-misc.el index 51923e9..d8cc3fa 100644 --- a/tests/test-org-drill-queue-and-misc.el +++ b/tests/test-org-drill-queue-and-misc.el @@ -63,6 +63,38 @@ ;; failed-entries is now empty. (should (null (oref session failed-entries)))))))) +(ert-deftest test-org-drill-pop-next-pending-entry-young-mature-branch () + "When failed and overdue are empty but young-mature has items, pops from there." + (with-fixed-now + (with-temp-buffer + (insert "* Young :drill:\n") + (org-mode) + (let* ((session (org-drill-session)) + (m (save-excursion (goto-char (point-min)) (point-marker)))) + (oset session start-time (float-time (current-time))) + (oset session young-mature-entries (list m)) + (let ((popped (org-drill-pop-next-pending-entry session))) + (should (eq m popped)) + (should (null (oref session young-mature-entries)))))))) + +(ert-deftest test-org-drill-pop-next-pending-entry-overdue-branch () + "When failed is empty and overdue has items, pops the head of the overdue list." + (with-fixed-now + (with-temp-buffer + (insert "* Over1 :drill:\n* Over2 :drill:\n") + (org-mode) + (let* ((session (org-drill-session)) + (m1 (save-excursion (goto-char (point-min)) (point-marker))) + (m2 (save-excursion (goto-char (point-min)) + (re-search-forward "^\\* Over2" nil t) + (line-beginning-position) + (point-marker)))) + (oset session start-time (float-time (current-time))) + (oset session overdue-entries (list m1 m2)) + (let ((popped (org-drill-pop-next-pending-entry session))) + (should (eq m1 popped)) + (should (equal (list m2) (oref session overdue-entries)))))))) + (ert-deftest test-org-drill-pop-next-pending-entry-falls-through-to-again () "When all primary queues are empty but again-entries has items, pops from again." (with-fixed-now |
