diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-27 21:40:43 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-27 21:40:43 -0500 |
| commit | a2a7471f88a8c0f5c710d5ffb90511fc54b432d7 (patch) | |
| tree | ff48348c21808986e5d196a68246781329c6dda8 /tests/test-org-drill-small-branch-coverage.el | |
| parent | 6e3f2d278d9598c6838428ee510445f51888bb30 (diff) | |
| download | org-drill-a2a7471f88a8c0f5c710d5ffb90511fc54b432d7.tar.gz org-drill-a2a7471f88a8c0f5c710d5ffb90511fc54b432d7.zip | |
refactor: take card-state in org-drill-determine-next-interval-sm5
Stage 4 of #147. sm5 now takes (state quality of-matrix &optional delta-days) instead of nine positional args, binding the recall fields from the struct at the top so the algorithm body is unchanged. Both call-site branches pass the state they already hold, dropping the per-branch accessor unpacking.
The testutil adapter test-scheduler--call-sm5 keeps the sm5 test calls a one-symbol rename per site. I also kept the return as the existing list, matching the stage-3 refinement: the goal is reducing the input signature, and changing the return shape would force the shared return-extractors and every return-read to change for no real gain.
Also folds in two stage-3 follow-ons I missed when sm2 landed: a direct sm5 call in tests/test-org-drill-small-branch-coverage.el now uses the new struct API inline, and five direct sm2 calls in the simple-workflow integration test now go through the testutil adapter (the integration file picks up the testutil-scheduler require). Caught by running make test-integration this stage, which I should have run on the sm2 stage.
Diffstat (limited to 'tests/test-org-drill-small-branch-coverage.el')
| -rw-r--r-- | tests/test-org-drill-small-branch-coverage.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test-org-drill-small-branch-coverage.el b/tests/test-org-drill-small-branch-coverage.el index 21b67c6..cb0ece7 100644 --- a/tests/test-org-drill-small-branch-coverage.el +++ b/tests/test-org-drill-small-branch-coverage.el @@ -21,7 +21,10 @@ the dispersal factor." (cl-letf (((symbol-function 'org-drill-random-dispersal-factor) (lambda () 1.5))) (let* ((result (org-drill-determine-next-interval-sm5 - 4.0 2 2.5 5 0 5.0 1 + (make-org-drill-card-state + :last-interval 4.0 :repetitions 2 :ease 2.5 + :failures 0 :meanq 5.0 :total-repeats 1) + 5 org-drill-sm5-optimal-factor-matrix)) (next (nth 0 result))) (should (numberp next)) |
