aboutsummaryrefslogtreecommitdiff
path: root/tests/test-gloss-drill--export-all-skips-already-tagged.el
Commit message (Collapse)AuthorAgeFilesLines
* feat: implement gloss-drill org-drill exportCraig Jennings2026-04-301-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two public commands plus a small helper. `gloss-drill-export-all' walks `gloss-file' via `org-map-entries' and adds `:drill:' tag and `DRILL_CARD_TYPE: twosided' property to every top-level entry. Membership and equality guards make the operation idempotent: re-running adds nothing and writes nothing. `gloss-drill-untag-all' is the reverse, and intentionally does not require `org-drill' to be installed (the user might be cleaning up after uninstalling). The walking logic factors into a single private helper `gloss-drill--map-entries' that handles file open, modtime verification, org-mode activation, the level-1 filter, and a write-only-if-modified save. Both public commands compose it with their respective per-entry mutators. `org-drill' presence is checked with `featurep' before any walk so the file is never touched when the dep is missing. The user-error message includes the install command. Folds in a small fix to the idempotency test helper: the original used `throw' from inside `org-map-entries' but did not return the count to the caller. Switched to `catch' / `throw' with the count as the throw value. 98 tests pass in 0.24s — 88 prior plus 10 new across the four scenarios named in the design doc (tags-untagged, skips-already-tagged, no-orgdrill-installed, untag-all).
* test: add gloss-drill test suite (red phase)Craig Jennings2026-04-301-0/+60
Four test files plus a small testutil for toggling the `org-drill' feature flag. All 10 tests fail at this commit because the implementation is still a stub. The suite covers Normal (untagged entries get the tag and property), Boundary (empty file, idempotency, untag never-tagged), and Error (org-drill not installed). The error path also asserts the file is left untouched. Untag-all is tested under both feature states because the user might want to remove tags after uninstalling org-drill.