aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-24 16:12:56 -0500
committerCraig Jennings <c@cjennings.net>2026-05-24 16:12:56 -0500
commitdf8b03e1d363c0867b31f87357c028342ceaee52 (patch)
treea0739d1e2dff981c8e0cf5613ff270769a5119b9
parent02eee4ddb2f7e4cf4d12d8cdb879b0200e806a5a (diff)
downloaddotemacs-df8b03e1d363c0867b31f87357c028342ceaee52.tar.gz
dotemacs-df8b03e1d363c0867b31f87357c028342ceaee52.zip
test: require host-environment in system-defaults tests
system-defaults reads `env-bsd-p` (host-environment) and `user-home-dir` (user-constants) at load, but the module declares both only via eval-when-compile. Loading the compiled module in isolation leaves `env-bsd-p` void, so the test failed whenever it ran outside a full init. I added the host-environment require alongside the existing user-constants require so the unit loads standalone. The production fix (promoting those eval-when-compile requires to a runtime require) is Phase 2 work, recorded in the module inventory.
-rw-r--r--tests/test-system-defaults-functions.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test-system-defaults-functions.el b/tests/test-system-defaults-functions.el
index 154e36783..a5210be01 100644
--- a/tests/test-system-defaults-functions.el
+++ b/tests/test-system-defaults-functions.el
@@ -31,9 +31,12 @@
(require 'server)
(require 'vc-hooks)
-;; user-constants supplies `user-home-dir' and `org-dir' that
-;; system-defaults reads. Required first so they hold real paths
-;; before the require fires the side effects we don't stub away.
+;; user-constants supplies `user-home-dir' and `org-dir', and
+;; host-environment supplies `env-bsd-p', both of which system-defaults
+;; reads at load. Required first so the symbols are defined before the
+;; require fires the side effects we don't stub away. (system-defaults
+;; itself declares these only via `eval-when-compile', so the compiled
+;; module cannot resolve them standalone — tracked as a Phase 2 fix.)
(add-to-list 'load-path
(file-name-concat
(file-name-directory
@@ -41,6 +44,7 @@
(file-name-directory (or load-file-name buffer-file-name))))
"modules"))
(require 'user-constants)
+(require 'host-environment)
;; Load system-defaults ONCE with side-effecting primitives stubbed.
;; This pattern lets undercover see and instrument the function