aboutsummaryrefslogtreecommitdiff
path: root/tests/testutil-scheduler.el
Commit message (Collapse)AuthorAgeFilesLines
* refactor: take card-state in org-drill-determine-next-interval-simple8Craig Jennings2026-05-271-0/+10
| | | | | | | | 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.
* refactor: take card-state in org-drill-determine-next-interval-sm5Craig Jennings2026-05-271-0/+9
| | | | | | | | 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.
* refactor: take card-state in org-drill-determine-next-interval-sm2Craig Jennings2026-05-271-0/+14
| | | | | | Stage 3 of #147. sm2 now takes (state quality) instead of seven positional args, binding the recall fields from the struct at the top so the algorithm body is unchanged. The smart-reschedule and hypothetical-next-review-date call sites pass the state they already hold, which drops the per-branch accessor unpacking. I kept the return as the existing positional list rather than restructuring it too. The goal is reducing the input signature, and changing the return shape would force the shared test extractors and every return-read to change for no real gain. A testutil adapter, test-scheduler--call-sm2, packs positional args into the struct, so the test call sites stay readable as the documented algorithm inputs and the migration is a one-symbol rename per call.
* refactor: extract shared scheduler test extractorsCraig Jennings2026-04-291-0/+47
Three test files (SM2, SM5, and the upcoming Simple8) all extract the same fields from a scheduler result list. Pull the shared extractors into tests/testutil-scheduler.el so each algorithm's test file can use them. Position 2 holds an EF in SM2 and SM5 and an EASE in Simple8. Both names are exposed as aliases pointing at the same nth position so each call site reads accurately. SM2 and SM5 test files now require testutil-scheduler and call the shared helpers. 69 of 69 scheduler tests still green. Full unit suite at 180 of 180.