aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* test: cover org-drill-time-to-inactive-org-timestamp (upstream #59)Craig Jennings2026-05-051-0/+90
| | | | | | | | I added a regression test for `org-drill-time-to-inactive-org-timestamp` to lock in the cherry-pick from commit 4c6e62a, which fixed upstream issue #59 on the GitLab tracker. Chipschap reported timestamps like `[Y-08-27 Wed 16:%]` getting written into DRILL_LAST_REVIEWED. The root cause is that Org 9.6+ dropped the angle brackets around `(cdr org-time-stamp-formats)`, so the original `(substring ... 1 -1)` started slicing off the leading `%` of `%Y` and the trailing `M` of `%M`. The fix took the Org 9.6+ branch via `(org-time-stamp-format t 'no-bracket)` instead. The new test file has 7 ERT tests across Normal, Boundary, and Error categories. The Error cases assert the output has no stray `%` characters and no literal `Y` in place of the year. I confirmed the same tests fail when I drop in the original buggy implementation, so they catch the bug shape from the report.
* build: add make coverage target via undercoverCraig Jennings2026-05-051-0/+33
| | | | | | | | | | I want to track test coverage as I work through the upstream issue backlog, so I added an undercover-based flow that mirrors how `make test-unit` already runs each file in its own Cask Emacs process. The Makefile gets `make coverage` and `make coverage-clean`. A new helper at `tests/run-coverage-file.el` instruments `org-drill.el` before the source is loaded. Undercover merges per-file results into a single simplecov JSON at `.coverage/simplecov.json`. I added `undercover` as a Cask development dep and `.coverage/` to `.gitignore` so the report stays local. I also renamed `make install` to `make setup`. The old name read like "deploy the package onto my system," but the target only installs Cask deps into the local `.cask/` directory. `setup` is closer to what it actually does, and all the internal `: install` prerequisites move with it. Baseline at this commit is 10.8% (208/1928 lines on org-drill.el).
* test: expect totaln increment on Simple8 failure pathCraig Jennings2026-04-291-4/+5
| | | | The failure-path assertion in the totaln test now expects the count to increment on both success and failure, matching SM2 and SM5. The updated test goes red against the current source. The source fix follows in the next commit.
* test: add Simple8 scheduler testsCraig Jennings2026-04-291-0/+303
| | | | | | | | | | The Simple8 algorithm at org-drill-determine-next-interval-simple8 had no direct test coverage, completing the trio after SM2 (37 tests) and SM5 (32 tests, just landed). Adds a per-function test file with 34 tests across Normal, Boundary, Error, algorithm-verification, and helper-specific categories. Simple8-specific surface gets dedicated coverage. The function returns a 6-element list (not 7 like SM2/SM5) and recomputes ease from meanq each call rather than carrying an EF parameter through. Failure does not increment totaln (different from SM2/SM5, which always increment). The four delta-days configurations (nil, positive × flag, negative × flag) each take a distinct code path, including a late-review use-n adjustment that SM5 doesn't have. The three pure-math helpers (simple8-first-interval, simple8-interval-factor, simple8-quality->ease) get five direct tests so polynomial-coefficient typos can't drift silently. All 34 pass on first run as characterization. Full suite at 214 of 214 (was 180, +34).
* refactor: extract shared scheduler test extractorsCraig Jennings2026-04-293-157/+156
| | | | | | | | 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.
* test: add SM5 scheduler testsCraig Jennings2026-04-291-0/+337
| | | | | | | | The SM5 algorithm at org-drill-determine-next-interval-sm5 had no direct test coverage. SM2 has 37 tests. SM5 has zero. Adds a per-function test file that mirrors the SM2 file's structure. 32 tests cover Normal, Boundary, Error, and algorithm-verification categories. The SM5-specific surface gets dedicated coverage. Failure preserves the input EF, not the modified one. The of-matrix is copied, not mutated. The four delta-days configurations (nil, positive, negative-with-flag, negative-without-flag) each take a different code path. The Error category includes should-error cases for the cl-assert preconditions on n and quality, which is a gap SM2's tests still have. All 32 pass on first run as characterization. Full suite at 180 of 180.
* test: Add boundary, error, and edge case testsCraig Jennings2025-11-135-0/+1082
| | | | | | | | Added 66 comprehensive tests covering: - Entry detection with extreme values and Unicode - SM2 algorithm with boundary conditions - Workflow error handling with malformed data - Card types with complex content structures
* test: Complete Phase 2 card type testsCraig Jennings2025-11-133-0/+271
| | | | | | | | | - Add unit tests for show1cloze card type (6 tests) - Add unit tests for multicloze variants (12 tests) - Add integration test for card type system (5 tests) Phase 2 complete: All major card types tested Total: 114 tests (98 unit + 16 integration), all passing
* test: Add Phase 2 card type testsCraig Jennings2025-11-133-0/+478
| | | | | | | | - Add unit tests for simple card type (11 tests) - Add unit tests for twosided card type (11 tests) - Add unit tests for hide1cloze card type (4 tests) Total: 91 tests (80 unit + 11 integration), all passing
* test: Add Phase 1 foundation tests for critical functionsCraig Jennings2025-11-135-0/+1068
| | | | | | | | | | | - Add unit tests for org-drill-entry-p (14 tests) - Add unit tests for org-drill-part-of-drill-entry-p (14 tests) - Add unit tests for SM2 scheduling algorithm (23 tests) - Add integration test for basic drill workflow (11 tests) - Update Makefile to support test-*.el naming pattern - Rename org-drill-test.el to test-org-drill.el for consistency Total: 65 tests, all passing
* refactor: Improve test infrastructure and fix all compiler warningsCraig Jennings2025-11-133-0/+701
This commit modernizes the test infrastructure and eliminates all compilation warnings to prepare for comprehensive test coverage. Test Infrastructure Improvements: - Reorganize tests from test/ to tests/ directory (standard convention) - Modernize Makefile with patterns from chime.el - Add convenient test targets (test-file, test-name) - Support unit and integration test separation - Better help documentation with examples - Auto-detect Cask installation location - Add comprehensive test-strategy.org document - 6-week implementation plan - Critical function prioritization - Integration test scenarios - Coverage goals (80% target) Compiler Warning Fixes (org-drill.el): - Replace obsolete org-mode functions: - org-show-subtree → org-fold-show-subtree - org-show-entry → org-fold-show-entry - org-get-tags-at → org-get-tags - org-remove-latex-fragment-image-overlays → org-clear-latex-preview - org-toggle-latex-fragment → org-latex-preview - org-bracket-link-regexp → org-link-bracket-re - Fix ~31 unescaped single quotes in docstrings (use \=') - Remove unused lexical variables (cb, drawer-name, session, orig-fun) - Remove obsolete outline-view-change-hook binding - Wrap org 8.x compatibility shim in with-no-warnings - Fix long docstring at line 1085 Test Status: - All 3 existing tests passing - Zero compilation warnings (was ~40 warnings) - Ready for Phase 1 implementation (foundation tests)