summaryrefslogtreecommitdiff
path: root/bog-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'bog-tests.el')
-rw-r--r--bog-tests.el28
1 files changed, 28 insertions, 0 deletions
diff --git a/bog-tests.el b/bog-tests.el
index 0532fc9..3fefc0b 100644
--- a/bog-tests.el
+++ b/bog-tests.el
@@ -328,6 +328,34 @@ other2000key <citekey>"
(bog-previous-non-heading-citekey 2)
(should (equal citekey (bog-citekey-at-point))))))
+;; `bog--find-citekey-heading-in-buffer'
+
+(ert-deftest bog--find-citekey-heading-in-buffer-citekey-heading ()
+ (let ((citekey "name2010word"))
+ (bog-tests--with-temp-text
+ "
+<point>
+* other heading
+
+* <citekey> "
+ (goto-char (bog--find-citekey-heading-in-buffer citekey))
+ (should (equal citekey (org-get-heading t t))))))
+
+(ert-deftest bog--find-citekey-heading-in-buffer-citekey-property ()
+ (let ((citekey "name2010word"))
+ (bog-tests--with-temp-text
+ (format "
+<point>
+* other heading
+
+* heading
+ :PROPERTIES:
+ :%s: <citekey>
+ :END"
+ bog-citekey-property)
+ (goto-char (bog--find-citekey-heading-in-buffer citekey))
+ (should (equal "heading" (org-get-heading t t))))))
+
;;; File functions