aboutsummaryrefslogtreecommitdiff
path: root/tests/test-calibredb-epub-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 18:17:22 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 18:17:22 -0500
commite0e0ecdb86e3ae1772adcedb50e6c9caa210cf17 (patch)
tree41a16c890b1ffb588635266d45fc484beb85f9de /tests/test-calibredb-epub-config.el
parentfc94e5b7101f6677950c414c2822b451351ccc56 (diff)
downloaddotemacs-e0e0ecdb86e3ae1772adcedb50e6c9caa210cf17.tar.gz
dotemacs-e0e0ecdb86e3ae1772adcedb50e6c9caa210cf17.zip
test: close coverage gaps from the preceding batch
Untested paths surfaced while reviewing the preceding feature/fix commits: - calendar-sync: a test that `-L' precedes `-l' in the worker command (separate `member' checks wouldn't catch a swap), plus a `:slow' tag on the real-subprocess worker test so it stays out of the default `make test' run. - org-capture cache: a killed marker buffer invalidates the entry and the next resolution rescans without erroring on the stale marker, `cj/org-capture-clear-target-cache' actually empties the hash, and non-`file+headline' targets (`file', `file+olp', `file+function') fall through to the original `org-capture-set-target-location'. - lorem-optimum: `cj/lipsum-title' on an empty chain returns "", not an error. - calibredb-epub: a negative `cj/nov-margin-percent' is clamped up to 0 (text takes the full window width). - mu4e attachments: the default save directory comes from the part's `:target-dir' and falls back to `~/Downloads/', and asking for the attachment at point on a header line fails with a `user-error'.
Diffstat (limited to 'tests/test-calibredb-epub-config.el')
-rw-r--r--tests/test-calibredb-epub-config.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-calibredb-epub-config.el b/tests/test-calibredb-epub-config.el
index 5b578b7d..53d2e78f 100644
--- a/tests/test-calibredb-epub-config.el
+++ b/tests/test-calibredb-epub-config.el
@@ -40,6 +40,17 @@
(lambda (&rest _) nil)))
(should (= 40 (cj/nov--text-width-for-window))))))
+(ert-deftest test-calibredb-epub-nov-text-width-clamps-negative-margin ()
+ "Boundary: a negative margin percent is clamped up to 0, so the text takes
+the full window width."
+ (let ((cj/nov-margin-percent -10)
+ (cj/nov-min-text-width 40))
+ (cl-letf (((symbol-function 'get-buffer-window)
+ (lambda (&rest _) 'window))
+ ((symbol-function 'window-body-width)
+ (lambda (_) 120)))
+ (should (= 120 (cj/nov--text-width-for-window))))))
+
(ert-deftest test-calibredb-epub-open-external-uses-zathura ()
"Normal: named Nov external-open command delegates to zathura."
(let (command)