aboutsummaryrefslogtreecommitdiff
path: root/tests/testutil-scheduler.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-27 21:47:19 -0500
committerCraig Jennings <c@cjennings.net>2026-05-27 21:47:19 -0500
commite45fec6778c1e483a73fb0f3652435f13b223f79 (patch)
tree7fa2dacb023b4cc6df2b407a91a0d95aa5f909bb /tests/testutil-scheduler.el
parenta2a7471f88a8c0f5c710d5ffb90511fc54b432d7 (diff)
downloadorg-drill-e45fec6778c1e483a73fb0f3652435f13b223f79.tar.gz
org-drill-e45fec6778c1e483a73fb0f3652435f13b223f79.zip
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.
Diffstat (limited to 'tests/testutil-scheduler.el')
-rw-r--r--tests/testutil-scheduler.el10
1 files changed, 10 insertions, 0 deletions
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