aboutsummaryrefslogtreecommitdiff
path: root/tests/test-custom-line-paragraph-duplicate-line-or-region.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-19 09:56:20 -0400
committerCraig Jennings <c@cjennings.net>2026-06-19 09:56:20 -0400
commit7dd9d187f37c8b05506ea125f6a6c16ba58b5711 (patch)
tree371046b99a498c8f06e7d0112d982e35efd5fdaf /tests/test-custom-line-paragraph-duplicate-line-or-region.el
parent153a84fcb8a4081a46a5ca7d79ecffed3b8ecc2b (diff)
downloaddotemacs-7dd9d187f37c8b05506ea125f6a6c16ba58b5711.tar.gz
dotemacs-7dd9d187f37c8b05506ea125f6a6c16ba58b5711.zip
test: cover pure-logic gaps found by the coverage audit
I ran make coverage and worked the report function by function, separating real gaps from interactive/IO wrappers that aren't unit-test targets. These tests fill the genuine pure-logic holes: predicates, parsers, formatters, transforms, and three modules that had no test file at all. New files cover car-member (local-repository), show-kill-insert-item (show-kill-ring), the oauth2-auto plstore cache fix (auth-config), the coverage-core project-root fallback, reconcile--dirty-p, and the recurrence-frequency dispatch in calendar-sync. Extended files add the missing branches: coverage-core's merge-base and diff /dev/null handling plus the staged and branch-vs-main scopes, the detect-system-timezone symlink path, user-constants no-op and optional-failure branches, the elfeed playlist branch with HTML-entity decoding, the duplicate-line no-comment-syntax guard, and several calendar-sync edges (exception field overrides, timestamp seconds and TZID fallback, property-line position advancement, parse-ics nil and out-of-range inputs). Mocks sit at the real boundaries (plstore, url-retrieve, process-file, git) so each function's own logic runs. Dates come from relative helpers. About 65 tests added across 15 files, and the full suite stays green.
Diffstat (limited to 'tests/test-custom-line-paragraph-duplicate-line-or-region.el')
-rw-r--r--tests/test-custom-line-paragraph-duplicate-line-or-region.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-custom-line-paragraph-duplicate-line-or-region.el b/tests/test-custom-line-paragraph-duplicate-line-or-region.el
index bd82e00f..84f5bc2d 100644
--- a/tests/test-custom-line-paragraph-duplicate-line-or-region.el
+++ b/tests/test-custom-line-paragraph-duplicate-line-or-region.el
@@ -447,5 +447,19 @@
(should (string-match-p "line\u000Cwith\u000Dcontrol\nline\u000Cwith\u000Dcontrol" (buffer-string))))
(test-duplicate-line-or-region-teardown)))
+;;; Error Cases
+
+(ert-deftest test-duplicate-line-or-region-comment-without-syntax-errors ()
+ "Error: requesting a comment in a mode with no comment syntax signals
+user-error rather than producing malformed output."
+ (test-duplicate-line-or-region-setup)
+ (unwind-protect
+ (with-temp-buffer
+ (fundamental-mode) ; no comment-start defined
+ (insert "line one")
+ (goto-char (point-min))
+ (should-error (cj/duplicate-line-or-region t) :type 'user-error))
+ (test-duplicate-line-or-region-teardown)))
+
(provide 'test-custom-line-paragraph-duplicate-line-or-region)
;;; test-custom-line-paragraph-duplicate-line-or-region.el ends here