aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/org-capture-config.el4
-rw-r--r--tests/test-org-capture-config-drill-template.el26
2 files changed, 28 insertions, 2 deletions
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el
index 755eecafb..c20504f04 100644
--- a/modules/org-capture-config.el
+++ b/modules/org-capture-config.el
@@ -130,8 +130,8 @@ Captured On: %U"
(completing-read "Choose file: " files)
drill-dir))))
"* Item :drill:\n%?
-** Answer\n%i\nSource: [[%:link][%:description]
-nCaptured On: %U" :prepend t)
+** Answer\n%i\nSource: [[%:link][%:description]]
+Captured On: %U" :prepend t)
("f" "Drill Question (from PDF)" entry
(file (lambda ()
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 000000000..8f13dbe91
--- /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