aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
commit4c06b26b6b4f399e3d45f00c281f24a33a15cc66 (patch)
treed36ec04c1c4774b3542decbb678e56eb2d3b4141 /tests
parent019057c7902ca0286b2ae9f0148f29bc53487dcd (diff)
downloaddotemacs-4c06b26b6b4f399e3d45f00c281f24a33a15cc66.tar.gz
dotemacs-4c06b26b6b4f399e3d45f00c281f24a33a15cc66.zip
fix(external-open): guard looping video open behind executable-find
The command fires via the find-file advice, so visiting a video without mpv on PATH threw an opaque call-process error mid-visit.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-external-open-commands.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test-external-open-commands.el b/tests/test-external-open-commands.el
index 3b2d32b8..5cab1196 100644
--- a/tests/test-external-open-commands.el
+++ b/tests/test-external-open-commands.el
@@ -89,6 +89,16 @@
;;; cj/find-file-auto
+(ert-deftest test-external-open-video-looping-errors-missing-program ()
+ "Error: a missing video player gives a clear user-error, not an opaque crash.
+The command fires via the find-file advice, so visiting a video on a
+machine without mpv must fail with a message naming the program."
+ (cl-letf (((symbol-function 'executable-find) (lambda (&rest _) nil))
+ ((symbol-function 'call-process)
+ (lambda (&rest _) (error "call-process should not run"))))
+ (should-error (cj/open-video-looping "/tmp/some-video.mp4")
+ :type 'user-error)))
+
(ert-deftest test-external-open-find-file-auto-routes-media-externally ()
"Normal: a non-video external extension (`.docx', in
`default-open-extensions') triggers `cj/xdg-open' instead of the original