aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cask2
-rw-r--r--org-drill.el2
-rw-r--r--tests/test-org-drill-org-9.6-dep.el44
3 files changed, 46 insertions, 2 deletions
diff --git a/Cask b/Cask
index 5da2b9a..7192f02 100644
--- a/Cask
+++ b/Cask
@@ -10,5 +10,5 @@
(depends-on "undercover")
(depends-on "package-lint")
(depends-on "elisp-lint"))
-(depends-on "org" "9.2")
+(depends-on "org" "9.6")
diff --git a/org-drill.el b/org-drill.el
index 1573c1a..e2d8310 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -5,7 +5,7 @@
;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
;; Author: Paul Sexton <eeeickythump@gmail.com>
;; Version: 2.7.0
-;; Package-Requires: ((emacs "25.3") (seq "2.14") (org "9.3") (persist "0.3"))
+;; Package-Requires: ((emacs "25.3") (seq "2.14") (org "9.6") (persist "0.3"))
;; Keywords: games, outlines, multimedia
;; URL: https://gitlab.com/phillord/org-drill/issues
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