aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.org3
-rw-r--r--lisp/seam-test.el14
2 files changed, 17 insertions, 0 deletions
diff --git a/CHANGES.org b/CHANGES.org
index c3dbca0..bee357b 100644
--- a/CHANGES.org
+++ b/CHANGES.org
@@ -32,3 +32,6 @@
- Buffer titles are now set correctly from narrowed buffers.
- An issue with regexp escape sequences being interpreted in template
variable replacements has been fixed.
+- Seam now validates note types entered with =C-u seam-set-note-type=,
+ averting any mishaps if your completing-read function returns an
+ invalid type.
diff --git a/lisp/seam-test.el b/lisp/seam-test.el
index e7658dd..5d4a562 100644
--- a/lisp/seam-test.el
+++ b/lisp/seam-test.el
@@ -358,6 +358,20 @@ backlink."
(insert-file-contents "html/bar.html")
(re-search-forward "<a href=\"/foo.html\">")))))
+(ert-deftest seam-test-backlinks-comment ()
+ "Test that a commented-out link does not add a backlink."
+ :expected-result :failed
+ (should-error
+ (identity
+ (seam-test-with-notes ((seam-export-template-string "{{backlinks}}"))
+ ((foo "foo" "public")
+ (bar "bar" "public"))
+ (with-current-buffer foo
+ (seam-test-add-contents foo (concat "# " (seam-test-link-to-buffer bar))))
+ (with-temp-buffer
+ (insert-file-contents "html/bar.html")
+ (re-search-forward "<a href=\"/foo.html\">"))))))
+
(ert-deftest seam-test-set-type-private ()
"Test that setting a public note to private will delete its HTML file and
update linking HTML files such that they no longer link to it."