From 7688cb0c61a757baab5fe830ed12520cb54756ae Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 11 Dec 2014 00:19:01 -0500 Subject: Add commands bog-{next,previous}-non-heading-citekey --- bog-tests.el | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'bog-tests.el') diff --git a/bog-tests.el b/bog-tests.el index 0173c5f..91bf252 100644 --- a/bog-tests.el +++ b/bog-tests.el @@ -254,6 +254,65 @@ some text and " ** second" (should-not (bog-citekey-from-surroundings)))) +;; bog-{next,previous}-non-heading-citekey + +(ert-deftest bog-next-non-heading-citekey-default-arg () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + " + + other2000key" + (bog-next-non-heading-citekey) + (should (equal citekey (bog-citekey-at-point)))))) + +(ert-deftest bog-next-non-heading-citekey-pos-arg () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + " + +other2000key " + (bog-next-non-heading-citekey 2) + (should (equal citekey (bog-citekey-at-point)))))) + +(ert-deftest bog-next-non-heading-citekey-on-citekey () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + " +other2000key +" + (bog-next-non-heading-citekey) + (should (equal citekey (bog-citekey-at-point)))))) + +(ert-deftest bog-next-non-heading-citekey-pos-neg-arg () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + " " + (bog-next-non-heading-citekey -1) + (should (equal citekey (bog-citekey-at-point)))))) + +(ert-deftest bog-previous-non-heading-citekey-default-arg () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + "other2000key " + (bog-previous-non-heading-citekey) + (should (equal citekey (bog-citekey-at-point)))))) + +(ert-deftest bog-previous-non-heading-citekey-on-citekey () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + " + +other2000key" + (bog-previous-non-heading-citekey) + (should (equal citekey (bog-citekey-at-point)))))) + +(ert-deftest bog-previous-non-heading-citekey-pos-arg () + (let ((citekey "name2010word")) + (bog-tests--with-temp-text + " other2000key " + (bog-previous-non-heading-citekey 2) + (should (equal citekey (bog-citekey-at-point)))))) + ;;; File functions -- cgit v1.2.3