aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-03 19:28:36 -0500
committerCraig Jennings <c@cjennings.net>2026-05-03 19:28:36 -0500
commit6a2539951416fd1ee2ad744090faf255031b71e7 (patch)
tree02710af7d57f07406808a0df4ef26e69b03986d4 /tests
parent389e85c020e7e59977e3c832a281f8b7844fecd4 (diff)
downloaddotemacs-6a2539951416fd1ee2ad744090faf255031b71e7.tar.gz
dotemacs-6a2539951416fd1ee2ad744090faf255031b71e7.zip
fix: close drill capture template source link
The "d" drill capture template had a malformed source link with only one closing bracket and a literal `n` where a newline should have been: Source: [[%:link][%:description] nCaptured On: %U So new drill captures wrote a broken link and `nCaptured On:` instead of a clean `Captured On:` line on the next row. I closed the link with the missing `]`, and removed the stray `n` so the line break before "Captured On" is just a real newline. The "f" (PDF drill) template was already correct, so I left it alone. I added `tests/test-org-capture-config-drill-template.el`. It loads the module, picks up the "d" template, and asserts both the closed link and the `\nCaptured On: %U` form, plus negative assertions against the broken pre-fix shapes.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-org-capture-config-drill-template.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test-org-capture-config-drill-template.el b/tests/test-org-capture-config-drill-template.el
new file mode 100644
index 00000000..8f13dbe9
--- /dev/null
+++ b/tests/test-org-capture-config-drill-template.el
@@ -0,0 +1,26 @@
+;;; test-org-capture-config-drill-template.el --- Tests for drill capture templates -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; Verifies the drill org-capture template remains well-formed.
+
+;;; Code:
+
+(require 'ert)
+(require 'org)
+
+(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
+(require 'org-capture-config)
+
+(ert-deftest test-org-capture-config-drill-template-source-link-is-closed ()
+ "The regular drill capture template should emit a valid source link."
+ (let ((template (nth 4 (assoc "d" org-capture-templates))))
+ (should (stringp template))
+ (should (string-match-p
+ "Source: \\[\\[%:link\\]\\[%:description\\]\\]"
+ template))
+ (should (string-match-p "\nCaptured On: %U" template))
+ (should-not (string-match-p "\\[%:description\\]\n" template))
+ (should-not (string-match-p "\nnCaptured On: %U" template))))
+
+(provide 'test-org-capture-config-drill-template)
+;;; test-org-capture-config-drill-template.el ends here