emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/beancount 77027e2cf8 037/103: beancount.el: Add outline-mi


From: ELPA Syncer
Subject: [nongnu] elpa/beancount 77027e2cf8 037/103: beancount.el: Add outline-minor-mode integration tests
Date: Mon, 29 Apr 2024 15:59:44 -0400 (EDT)

branch: elpa/beancount
commit 77027e2cf8b42737835ab6d1d875a26b42341b89
Author: Daniele Nicolodi <daniele@grinta.net>
Commit: Daniele Nicolodi <daniele@grinta.net>

    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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]