diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 09:08:25 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 09:08:25 -0500 |
| commit | 75b16019e0cd8de4213719df552b6d4c5a2a699e (patch) | |
| tree | 3e4b57475e5c241abbb8d3ab882efebb241ead2b /tests | |
| parent | 53d4b9654627c206d14b1345a4efe0a3e70d38d2 (diff) | |
| download | org-drill-75b16019e0cd8de4213719df552b6d4c5a2a699e.tar.gz org-drill-75b16019e0cd8de4213719df552b6d4c5a2a699e.zip | |
build: bump Org dep to 9.6 to match unguarded org-fold-* calls
org-drill calls org-fold-show-entry and org-fold-show-subtree from
seven sites without fboundp guards. Both functions arrived in Org
9.6. But the package declared org 9.3 (Package-Requires) /
org 9.2 (Cask), so users on older Org would silently void-function
at runtime instead of getting a clear install-time mismatch error.
Bumped both declarations to org 9.6. Wrapping each of the seven
call sites with fboundp would be the alternative, but Org 9.6 was
released October 2022 — three-and-a-half years ago — and we already
have a follow-up TODO to drop the legacy time-to-inactive fallback
that this version bump unblocks.
Two tests verify the declared dep and that the org-fold APIs are
actually bound on the running Org version.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-org-drill-org-9.6-dep.el | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/test-org-drill-org-9.6-dep.el b/tests/test-org-drill-org-9.6-dep.el new file mode 100644 index 0000000..74a3f2a --- /dev/null +++ b/tests/test-org-drill-org-9.6-dep.el @@ -0,0 +1,44 @@ +;;; test-org-drill-org-9.6-dep.el --- Test Org dep declarations match runtime needs -*- lexical-binding: t; -*- + +;;; Commentary: +;; org-drill calls `org-fold-show-entry' and `org-fold-show-subtree' +;; from seven sites without `fboundp' guards. Both functions arrived +;; in Org 9.6. Pre-fix the package declared `(org "9.3")' / +;; `(depends-on "org" "9.2")', so users on older Org would silently +;; void-function at runtime instead of getting a clear install-time +;; error. +;; +;; Bumping the dep to 9.6 makes the requirement explicit and lets us +;; call the new APIs without per-site guards. Tests verify the +;; declared deps and that the API symbols are actually bound. + +;;; Code: + +(require 'ert) +(require 'org) +(require 'org-drill) + +;;;; Dep declarations + +(ert-deftest test-org-drill-package-requires-org-9.6-or-newer () + "The Package-Requires header declares org 9.6+ — matches the runtime +need for org-fold-show-entry/-subtree." + (let ((header-line + (with-temp-buffer + (insert-file-contents + (locate-library "org-drill") nil 0 4096) + (goto-char (point-min)) + (when (re-search-forward "Package-Requires:.*$" nil t) + (match-string 0))))) + (should header-line) + (should (string-match-p "(org \"9\\.6\\|9\\.[7-9]\\|[1-9][0-9]" header-line)))) + +(ert-deftest test-org-drill-org-fold-functions-bound () + "On any supported Org version (>= 9.6), the org-fold APIs we call +without guards are actually bound." + (should (fboundp 'org-fold-show-entry)) + (should (fboundp 'org-fold-show-subtree))) + +(provide 'test-org-drill-org-9.6-dep) + +;;; test-org-drill-org-9.6-dep.el ends here |
