branch: elpa/beancount
commit 77027e2cf8b42737835ab6d1d875a26b42341b89
Author: Daniele Nicolodi <[email protected]>
Commit: Daniele Nicolodi <[email protected]>
beancount.el: Add outline-minor-mode integration tests
---
beancount-tests.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/beancount-tests.el b/beancount-tests.el
index 7624a6300f..6bdd2edea3 100644
--- a/beancount-tests.el
+++ b/beancount-tests.el
@@ -170,3 +170,49 @@ known option nmaes."
Expenses:Test
"))
(should (equal beancount-accounts '("Assets:Checking" "Expenses:Test")))))
+
+(ert-deftest beancount/outline-001 ()
+ :tags '(outline)
+ (with-temp-buffer
+ (insert "
+* A
+** B
+*** C
+")
+ (beancount-mode)
+ (outline-minor-mode)
+ (forward-line -1)
+ (should (looking-at beancount-outline-regexp))
+ (should (equal (beancount-outline-level) 3))))
+
+(ert-deftest beancount/outline-002 ()
+ :tags '(outline)
+ (with-temp-buffer
+ (insert "
+;;; A
+;;;; B
+;;;;; C
+")
+ (beancount-mode)
+ (outline-minor-mode)
+ (forward-line -1)
+ (should (looking-at beancount-outline-regexp))
+ (should (equal (beancount-outline-level) 3))))
+
+(ert-deftest beancount/outline-fontify-001 ()
+ :tags '(outline)
+ (let ((fontified
+ (with-temp-buffer
+ (insert "
+* A
+** B
+*** C
+")
+ (beancount-mode)
+ (outline-minor-mode)
+ (font-lock-ensure)
+ (buffer-string))))
+ (should (equal (beancount-test-face-groups fontified)
+ '("* A" org-level-1
+ "** B" org-level-2
+ "*** C" org-level-3)))))