branch: elpa/markdown-mode
commit c3c2f0d473a3f8ca8c4ffb2ecc094d5c3541769f
Merge: 1c459f7 981e48c
Author: Shohei YOSHIDA <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #668 from edrex/test-wiki-link-follow-new-file
Test following wiki link to nonexistent file works
---
tests/markdown-test.el | 12 ++++++++++++
tests/wiki/foo.md | 1 +
2 files changed, 13 insertions(+)
diff --git a/tests/markdown-test.el b/tests/markdown-test.el
index 4c7d92a..33310fb 100644
--- a/tests/markdown-test.el
+++ b/tests/markdown-test.el
@@ -6604,6 +6604,18 @@ Detail:
https://github.com/jrblevin/markdown-mode/pull/590"
(should (eq major-mode 'gfm-mode)))
(kill-buffer))))
+(ert-deftest test-markdown-ext/wiki-link-nonexistent-file ()
+ "Test following wiki link to nonexistent file visits the buffer."
+ (let ((markdown-enable-wiki-links t))
+ (find-file (expand-file-name "wiki/foo.md" markdown-test-dir))
+ (unwind-protect
+ (progn
+ (markdown-mode)
+ (search-forward "[[doesnotexist]]")
+ (markdown-follow-wiki-link-at-point)
+ (should (string= (buffer-name) "doesnotexist.md")))
+ (kill-buffer))))
+
(defadvice markdown-live-preview-window-eww
(around markdown-test-create-fake-eww disable)
(setq ad-return-value (get-buffer-create "*eww*")))
diff --git a/tests/wiki/foo.md b/tests/wiki/foo.md
new file mode 100644
index 0000000..cef18a9
--- /dev/null
+++ b/tests/wiki/foo.md
@@ -0,0 +1 @@
+[[doesnotexist]]