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 | b7389d3a99197c08b4f1fa3627ef00a934574616 (patch) | |
| tree | 08923716c90c354214654a0934e38551f617645c | |
| parent | f5013b2cb62310e84a90818c1bdcbfde3b230728 (diff) | |
| download | dotemacs-b7389d3a99197c08b4f1fa3627ef00a934574616.tar.gz dotemacs-b7389d3a99197c08b4f1fa3627ef00a934574616.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.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 |
