summaryrefslogtreecommitdiff
path: root/bog-tests.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-06-05 01:05:26 -0400
committerKyle Meyer <kyle@kyleam.com>2014-06-05 01:05:26 -0400
commitefa6371a320de31b3e549d591cc50fc739286bff (patch)
tree041805b6ee7a753f74664907ff06662ac1f27f1b /bog-tests.el
parent66cf8cddc05ba8a74926162794f4e5cb681fb697 (diff)
downloadbog-efa6371a320de31b3e549d591cc50fc739286bff.tar.gz
Remove bog-citekey-function
Before, citekeys could be listed as either heading titles or properties, but these two styles could not be mixed. Now, they can, and the following method is used to find the citekey. 1. Take the citekey from title of the current heading. 2. Take the citekey from the property of the current heading. 3. If no citekey found, go to parent heading and repeat. The process stops as soon as a citekey is found or a top-level heading is reached.
Diffstat (limited to 'bog-tests.el')
-rw-r--r--bog-tests.el16
1 files changed, 7 insertions, 9 deletions
diff --git a/bog-tests.el b/bog-tests.el
index 0ce46ad..34b4354 100644
--- a/bog-tests.el
+++ b/bog-tests.el
@@ -54,7 +54,7 @@
(goto-char (point-min))
(should (equal (bog-citekey-at-point) citekey)))))
-;; `bog-citekey-from-heading-title'
+;; `bog-citekey-from-tree'
(ert-deftest bog-citekey-from-heading-title-current-level ()
(let ((citekey "name2010word"))
@@ -63,7 +63,7 @@
citekey))
(org-mode)
(show-all)
- (should (equal (bog-citekey-from-heading-title) citekey)))))
+ (should (equal (bog-citekey-from-tree) citekey)))))
(ert-deftest bog-citekey-from-heading-title-in-parent ()
(let ((citekey "name2010word"))
@@ -72,7 +72,7 @@
citekey))
(org-mode)
(show-all)
- (should (equal (bog-citekey-from-heading-title) citekey)))))
+ (should (equal (bog-citekey-from-tree) citekey)))))
(ert-deftest bog-citekey-from-heading-title-on-heading ()
(let ((citekey "name2010word"))
@@ -82,9 +82,7 @@
(org-mode)
(show-all)
(re-search-backward bog-citekey-format)
- (should (equal (bog-citekey-from-heading-title) citekey)))))
-
-;; `bog-citekey-from-property'
+ (should (equal (bog-citekey-from-tree) citekey)))))
(ert-deftest bog-citekey-from-property-current-level ()
(let ((citekey "name2010word"))
@@ -94,7 +92,7 @@
":END:\nsome text\n")
(org-mode)
(show-all)
- (should (equal (bog-citekey-from-property) citekey)))))
+ (should (equal (bog-citekey-from-tree) citekey)))))
(ert-deftest bog-citekey-from-property-in-parent ()
(let ((citekey "name2010word"))
@@ -105,7 +103,7 @@
"** subhead\n\n")
(org-mode)
(show-all)
- (should (equal (bog-citekey-from-property) citekey)))))
+ (should (equal (bog-citekey-from-tree) citekey)))))
(ert-deftest bog-citekey-from-property-on-heading ()
(let ((citekey "name2010word"))
@@ -116,7 +114,7 @@
(org-mode)
(show-all)
(org-back-to-heading)
- (should (equal (bog-citekey-from-property) citekey)))))
+ (should (equal (bog-citekey-from-tree) citekey)))))
;; `bog-citekey-from-notes'