From 474a9bed31c583761e55b6072f07fcfd6d095471 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 26 Aug 2026 12:25:39 -0600 Subject: test: repair the seven files red under Emacs 31.1 None of the seven was a config regression. Each file had its own cause: - config-utilities: the tests mocked fboundp with cl-letf. fset on a subr autoloads comp-run, which requires bytecomp, whose defun of byte-compile-file replaced the mock installed earlier in the same cl-letf. 30.2 hid it because ert happened to load bytecomp first. I extracted cj/--compile-elisp-file with an injectable availability predicate (fboundp by default), made cj/compile-this-elisp-buffer the wrapper, and had the tests inject a predicate instead of redefining a primitive. Added the missing no-compiler case. - system-defaults-functions: the file let-bound use-package-always-ensure before anything declared it special. 30.2 downgraded that to a "Failed to parse package recentf" warning; 31.1 moves the defcustom to autoload time, where it is fatal at load. One defvar before the let. - calibredb-epub-config: the jump tests stubbed calibredb while it was still an autoload, so the module's require loaded the real definition over the stub and the real command always ran. Require calibredb before any stub. - agenda-query--render: org 9.8.7 parses the priority cookie with (looking-at org-priority-regexp), whose lazy prefix swallows everything between the stars and the cookie. The fixture now has no cookie and pins that the keyword is not recognised. - prog-general-yas-activation: python-ts-mode prompts to install a missing grammar, which a batch run cannot answer. The test skips on treesit-ready-p rather than on the mode existing, and the module comment says why. - integration-recurring-events: the fixtures are America/Chicago and the assertions expect Chicago rendering, so the file only passed on a machine in Central time. TZ is pinned in setup and restored in teardown. The integration failure had been invisible since 08-17 because make test stops after a red unit phase. make test exits 0 again for the first time since then. --- tests/test-system-defaults-functions.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test-system-defaults-functions.el') diff --git a/tests/test-system-defaults-functions.el b/tests/test-system-defaults-functions.el index 4b647166..09bf9f2a 100644 --- a/tests/test-system-defaults-functions.el +++ b/tests/test-system-defaults-functions.el @@ -55,6 +55,12 @@ ;; so it doesn't leak into a shared batch session. `make test-name' loads ;; every test file into one Emacs; a leaked cwd there breaks the relative ;; loads of every file that follows. +;; Declared special before the `let' below binds it: this file is lexical, +;; so without the defvar the binding is a lexical local, and use-package's +;; own `defcustom' then fails with "Defining as dynamic an already lexical +;; var" (fatal at load since 31.1 moved the defcustom to autoload time). +(defvar use-package-always-ensure) + (let ((default-directory default-directory) (use-package-always-ensure nil)) (cl-letf (((symbol-function 'server-running-p) (lambda (&rest _) t)) -- cgit v1.2.3