aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-18 18:24:01 -0500
committerCraig Jennings <c@cjennings.net>2026-07-18 18:24:01 -0500
commit11eb84175a30b96e3fa179723bc486a88d102d05 (patch)
tree6ae85ae210340c7c7de3661d810cfc04e91c72bb /tests
parentfbd69990f7e3731a6df4ed992f1aefaef3748750 (diff)
downloaddotemacs-11eb84175a30b96e3fa179723bc486a88d102d05.tar.gz
dotemacs-11eb84175a30b96e3fa179723bc486a88d102d05.zip
fix(shell): require external-open, scope tramp revert, drop dead config
- dirvish-config, dwim-shell-config: both call cj/xdg-open (external-open) but relied on init.el requiring it before them, and dirvish's require comment misattributed it to system-utils. Added the require to both and corrected the comment and both Runtime-requires headers. - tramp-config: revert-without-query was set to '(".*") inside the TRAMP module, so every file in Emacs reverted without confirmation. Scoped it to the TRAMP path regexp, so local files keep their revert prompt and remote files skip the round-trip. - tramp-config: removed the sshfast method (referenced nowhere, scp and sshx handle everything) and a duplicate tramp-own-remote-path add-to-list. Tests: new runtime-requires assertions for both modules, red first under make test-file. The tramp :config edits are verified in the daemon. Suite green.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-dirvish-config-runtime-requires.el24
-rw-r--r--tests/test-dwim-shell-config-runtime-requires.el24
2 files changed, 39 insertions, 9 deletions
diff --git a/tests/test-dirvish-config-runtime-requires.el b/tests/test-dirvish-config-runtime-requires.el
index 34fb67ac..ca94e4b5 100644
--- a/tests/test-dirvish-config-runtime-requires.el
+++ b/tests/test-dirvish-config-runtime-requires.el
@@ -3,15 +3,13 @@
;;; Commentary:
;; dirvish-config.el builds `dirvish-quick-access-entries' from `code-dir',
;; `music-dir', `pix-dir' (and friends) at load time and binds keys to
-;; `cj/xdg-open' / `cj/open-file-with-command', so it depends on user-constants
-;; and system-utils at runtime. Those were declared with `eval-when-compile',
-;; which leaves the compiled module without the requires at load — fragile
-;; under init order. This is a dependency-contract smoke test: requiring
-;; dirvish-config in isolation must pull both features in, so it fails if the
-;; requires are dropped entirely. (It can't catch a downgrade back to
-;; `eval-when-compile', since that form still runs when the file loads as
-;; source, which the test harness does — that regression is guarded by keeping
-;; the plain requires in review, not by this test.)
+;; `cj/xdg-open' (external-open) and `cj/open-file-with-command'
+;; (system-utils), so it depends on user-constants, system-utils, and
+;; external-open at runtime. This is a dependency-contract smoke test:
+;; requiring dirvish-config in isolation must pull those features in, so it
+;; fails if the requires are dropped entirely. Run it with `make test-file'
+;; for a clean signal: in the full suite another file may already have loaded
+;; external-open, masking a regression here.
;;; Code:
@@ -26,5 +24,13 @@
"Normal: requiring dirvish-config pulls in system-utils at runtime."
(should (featurep 'system-utils)))
+(ert-deftest test-dirvish-config-loads-external-open ()
+ "Normal: requiring dirvish-config pulls in external-open at runtime.
+The keys `o' and the OS-handler fallback call `cj/xdg-open', which lives
+in external-open; without the require the binding works only when init
+order happens to load external-open first."
+ (should (featurep 'external-open))
+ (should (fboundp 'cj/xdg-open)))
+
(provide 'test-dirvish-config-runtime-requires)
;;; test-dirvish-config-runtime-requires.el ends here
diff --git a/tests/test-dwim-shell-config-runtime-requires.el b/tests/test-dwim-shell-config-runtime-requires.el
new file mode 100644
index 00000000..ab53e7d4
--- /dev/null
+++ b/tests/test-dwim-shell-config-runtime-requires.el
@@ -0,0 +1,24 @@
+;;; test-dwim-shell-config-runtime-requires.el --- dwim-shell-config declares its deps -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; dwim-shell-config.el calls `cj/xdg-open' (external-open) to open a
+;; conversion's output file, but declared it only with `declare-function'
+;; and never required external-open. The binding works at runtime only
+;; because init.el happens to load external-open first — fragile under init
+;; order, and the "Direct test load: yes" header claims otherwise. This is
+;; a dependency-contract smoke test: requiring dwim-shell-config in isolation
+;; must pull external-open in. Run with `make test-file' for a clean signal;
+;; in the full suite another file may already have loaded external-open.
+
+;;; Code:
+
+(require 'ert)
+(require 'dwim-shell-config)
+
+(ert-deftest test-dwim-shell-config-loads-external-open ()
+ "Normal: requiring dwim-shell-config pulls in external-open at runtime."
+ (should (featurep 'external-open))
+ (should (fboundp 'cj/xdg-open)))
+
+(provide 'test-dwim-shell-config-runtime-requires)
+;;; test-dwim-shell-config-runtime-requires.el ends here