diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-27 20:47:35 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-27 20:47:35 -0500 |
| commit | 39d01b75ac679410821ce5e16c09ec6b7799f791 (patch) | |
| tree | d825389532e98a9bcfc3fddd87b787c7879c5dcc /tests/test-org-drill-cloze-and-scheduling-helpers.el | |
| parent | 198e772efbb17cc8dbd514b0c0487d780c5e3eaa (diff) | |
| download | org-drill-39d01b75ac679410821ce5e16c09ec6b7799f791.tar.gz org-drill-39d01b75ac679410821ce5e16c09ec6b7799f791.zip | |
refactor: thread card-state struct through the item-data round-trip
Second step of #147. get-item-data now returns an org-drill-card-state and store-item-data takes one, so the six recall fields move as named slots instead of a positional list. The three call sites (smart-reschedule, hypothetical-next-review-date, copy-scheduling-to-marker) read scheduler inputs through accessors and build a struct for the store, which removes the hand re-ordering between the get-shape and the store-shape.
Behavior is unchanged. The legacy LEARN_DATA read path and the virgin-item sentinel are preserved field-for-field, and store takes just the struct because its last-interval slot already holds the interval to persist. The schedulers still take positional args; they adopt the struct in the following commits.
I updated the round-trip, integration, and setup-helper tests to build and read the struct via a small list-view helper, so the existing expected-value assertions stay readable.
Diffstat (limited to 'tests/test-org-drill-cloze-and-scheduling-helpers.el')
| -rw-r--r-- | tests/test-org-drill-cloze-and-scheduling-helpers.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-org-drill-cloze-and-scheduling-helpers.el b/tests/test-org-drill-cloze-and-scheduling-helpers.el index 1ee4c61..39573aa 100644 --- a/tests/test-org-drill-cloze-and-scheduling-helpers.el +++ b/tests/test-org-drill-cloze-and-scheduling-helpers.el @@ -148,7 +148,7 @@ roughly old + max(1, (next-old)/2) days." (with-fresh-drill-entry ;; Set up a card that's been reviewed before, with weight = 2. (org-set-property "DRILL_CARD_WEIGHT" "2") - (org-drill-store-item-data 10 3 0 3 4.5 2.5) + (org-drill-store-item-data (make-org-drill-card-state :last-interval 10 :repetitions 3 :failures 0 :total-repeats 3 :meanq 4.5 :ease 2.5)) (let ((q5-no-weight (progn (org-delete-property "DRILL_CARD_WEIGHT") (org-drill-hypothetical-next-review-date 5))) @@ -180,7 +180,7 @@ This is what users see in the prompt: `1 / 2 / 3 / 4 / 6 / 9' style hints." (ert-deftest test-org-drill-strip-entry-data-removes-scheduling-properties () "Stripping wipes every property listed in `org-drill-scheduling-properties'." (with-fresh-drill-entry - (org-drill-store-item-data 10 3 1 5 3.8 2.4) + (org-drill-store-item-data (make-org-drill-card-state :last-interval 10 :repetitions 3 :failures 1 :total-repeats 5 :meanq 3.8 :ease 2.4)) ;; sanity: the props are there (should (org-entry-get (point) "DRILL_LAST_INTERVAL")) (org-drill-strip-entry-data) |
