diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 16:12:56 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 16:12:56 -0500 |
| commit | 9a0560e87867dc2a23767f66940ba4fb4d5a5c20 (patch) | |
| tree | 0f29d1d3eb516cd30e87657c390235575c0a38e6 /tests | |
| parent | 6479f122c3544d29fefedd749f6adaf29aca04af (diff) | |
| download | dotemacs-9a0560e87867dc2a23767f66940ba4fb4d5a5c20.tar.gz dotemacs-9a0560e87867dc2a23767f66940ba4fb4d5a5c20.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.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-system-defaults-functions.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test-system-defaults-functions.el b/tests/test-system-defaults-functions.el index 154e3678..a5210be0 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 |
