From e45fec6778c1e483a73fb0f3652435f13b223f79 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 27 May 2026 21:47:19 -0500 Subject: refactor: take card-state in org-drill-determine-next-interval-simple8 Stage 5 of #147, closing the scheduler migration. simple8 now takes (state quality &optional delta-days) instead of seven positional args, binding the recall fields from the struct at the top so the algorithm body is unchanged. simple8 doesn't use ease, so the binding skips that slot. Both call-site branches collapse to (state quality [delta-days]), dropping the per-branch accessor unpacking. The testutil adapter test-scheduler--call-simple8 keeps the simple8 test calls a one-symbol rename per site. One direct simple8 call in tests/test-org-drill-prompt-and-format-helpers.el now uses the new struct API inline. With this stage landed, all three schedulers, the item-data round-trip, and every test caller go through the org-drill-card-state struct, finishing #147. --- tests/testutil-scheduler.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/testutil-scheduler.el') diff --git a/tests/testutil-scheduler.el b/tests/testutil-scheduler.el index 0d28b7a..126e6e8 100644 --- a/tests/testutil-scheduler.el +++ b/tests/testutil-scheduler.el @@ -66,5 +66,15 @@ Use this name in Simple8 tests where the field is called `ease' not `ef'." :failures failures :meanq meanq :total-repeats total-repeats) quality of-matrix delta-days)) +(defun test-scheduler--call-simple8 (last-interval repeats quality failures + meanq totaln &optional delta-days) + "Call the Simple8 scheduler from positional args, packing them into a card-state. +Simple8 doesn't use the ease slot; it's left unset in the struct." + (org-drill-determine-next-interval-simple8 + (make-org-drill-card-state + :last-interval last-interval :repetitions repeats + :failures failures :meanq meanq :total-repeats totaln) + quality delta-days)) + (provide 'testutil-scheduler) ;;; testutil-scheduler.el ends here -- cgit v1.2.3