[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org f0447de 22/41: Set org-adapt-indentation explicitly
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org f0447de 22/41: Set org-adapt-indentation explicitly in some tests |
Date: |
Sun, 16 May 2021 04:57:19 -0400 (EDT) |
branch: externals/org
commit f0447de94193d24c4e8b2f23169fb7bdf175ec94
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Commit: Bastien <bzg@gnu.org>
Set org-adapt-indentation explicitly in some tests
* testing/lisp/test-org.el (test-org/indent-line)
(test-org/indent-region): Make sure `org-adapt-indentation' is
consistent with expected results.
---
testing/lisp/test-org.el | 126 +++++++++++++++++++++++++----------------------
1 file changed, 66 insertions(+), 60 deletions(-)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 5ac9173..95ffb0a 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1007,22 +1007,23 @@
;; At the first line of an element, indent like previous element's
;; first line, ignoring footnotes definitions and inline tasks, or
;; according to parent.
- (should
- (= 2
- (org-test-with-temp-text "A\n\n B\n\nC<point>"
- (org-indent-line)
- (org-get-indentation))))
- (should
- (= 1
- (org-test-with-temp-text " A\n\n[fn:1] B\n\n\nC<point>"
- (org-indent-line)
- (org-get-indentation))))
- (should
- (= 1
- (org-test-with-temp-text
- " #+BEGIN_CENTER\n<point> Contents\n#+END_CENTER"
- (org-indent-line)
- (org-get-indentation))))
+ (let ((org-adapt-indentation t))
+ (should
+ (= 2
+ (org-test-with-temp-text "A\n\n B\n\nC<point>"
+ (org-indent-line)
+ (org-get-indentation))))
+ (should
+ (= 1
+ (org-test-with-temp-text " A\n\n[fn:1] B\n\n\nC<point>"
+ (org-indent-line)
+ (org-get-indentation))))
+ (should
+ (= 1
+ (org-test-with-temp-text
+ " #+BEGIN_CENTER\n<point> Contents\n#+END_CENTER"
+ (org-indent-line)
+ (org-get-indentation)))))
;; Within code part of a source block, use language major mode if
;; `org-src-tab-acts-natively' is non-nil. Otherwise, indent
;; according to line above.
@@ -1066,11 +1067,12 @@
(ert-deftest test-org/indent-region ()
"Test `org-indent-region' specifications."
;; Indent paragraph.
- (should
- (equal "A\nB\nC"
- (org-test-with-temp-text " A\nB\n C"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
+ (let ((org-adapt-indentation t))
+ (should
+ (equal "A\nB\nC"
+ (org-test-with-temp-text " A\nB\n C"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string)))))
;; Indent greater elements along with their contents.
(should
(equal "#+BEGIN_CENTER\nA\nB\n#+END_CENTER"
@@ -1083,11 +1085,12 @@
(org-test-with-temp-text "#+BEGIN_VERSE\n A\n B\n#+END_VERSE"
(org-indent-region (point-min) (point-max))
(buffer-string))))
- (should
- (equal "#+BEGIN_VERSE\n A\n B\n#+END_VERSE"
- (org-test-with-temp-text " #+BEGIN_VERSE\n A\n B\n #+END_VERSE"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
+ (let ((org-adapt-indentation t))
+ (should
+ (equal "#+BEGIN_VERSE\n A\n B\n#+END_VERSE"
+ (org-test-with-temp-text " #+BEGIN_VERSE\n A\n B\n #+END_VERSE"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string)))))
;; Indent example blocks as a single block, unless indentation
;; should be preserved. In this case only indent the block markers.
(should
@@ -1095,36 +1098,38 @@
(org-test-with-temp-text "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE"
(org-indent-region (point-min) (point-max))
(buffer-string))))
- (should
- (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE"
- (org-test-with-temp-text " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
- (should
- (equal "#+BEGIN_EXAMPLE -i\n A\n B\n#+END_EXAMPLE"
- (org-test-with-temp-text
- " #+BEGIN_EXAMPLE -i\n A\n B\n #+END_EXAMPLE"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
- (should
- (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE"
- (org-test-with-temp-text
- " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE"
- (let ((org-src-preserve-indentation t))
- (org-indent-region (point-min) (point-max)))
- (buffer-string))))
+ (let ((org-adapt-indentation t))
+ (should
+ (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE"
+ (org-test-with-temp-text " #+BEGIN_EXAMPLE\n A\n B\n
#+END_EXAMPLE"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string))))
+ (should
+ (equal "#+BEGIN_EXAMPLE -i\n A\n B\n#+END_EXAMPLE"
+ (org-test-with-temp-text
+ " #+BEGIN_EXAMPLE -i\n A\n B\n #+END_EXAMPLE"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string))))
+ (should
+ (equal "#+BEGIN_EXAMPLE\n A\n B\n#+END_EXAMPLE"
+ (org-test-with-temp-text
+ " #+BEGIN_EXAMPLE\n A\n B\n #+END_EXAMPLE"
+ (let ((org-src-preserve-indentation t))
+ (org-indent-region (point-min) (point-max)))
+ (buffer-string)))))
;; Treat export blocks as a whole.
(should
(equal "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT"
(org-test-with-temp-text "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT"
(org-indent-region (point-min) (point-max))
(buffer-string))))
- (should
- (equal "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT"
- (org-test-with-temp-text
- " #+BEGIN_EXPORT latex\n A\n B\n #+END_EXPORT"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
+ (let ((org-adapt-indentation t))
+ (should
+ (equal "#+BEGIN_EXPORT latex\n A\n B\n#+END_EXPORT"
+ (org-test-with-temp-text
+ " #+BEGIN_EXPORT latex\n A\n B\n #+END_EXPORT"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string)))))
;; Indent according to mode if `org-src-tab-acts-natively' is
;; non-nil. Otherwise, do not indent code at all.
(should
@@ -1160,16 +1165,17 @@
(org-indent-region (point) (point-max)))
(buffer-string))))
;; Indent plain lists.
- (should
- (equal "- A\n B\n - C\n\n D"
- (org-test-with-temp-text "- A\n B\n - C\n\n D"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
- (should
- (equal "- A\n\n- B"
- (org-test-with-temp-text " - A\n\n - B"
- (org-indent-region (point-min) (point-max))
- (buffer-string))))
+ (let ((org-adapt-indentation t))
+ (should
+ (equal "- A\n B\n - C\n\n D"
+ (org-test-with-temp-text "- A\n B\n - C\n\n D"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string))))
+ (should
+ (equal "- A\n\n- B"
+ (org-test-with-temp-text " - A\n\n - B"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string)))))
;; Indent footnote definitions.
(should
(equal "[fn:1] Definition\n\nDefinition"
- [elpa] externals/org 8531bb6 09/41: lisp/org.el: Minor aesthetic clean-up, (continued)
- [elpa] externals/org 8531bb6 09/41: lisp/org.el: Minor aesthetic clean-up, ELPA Syncer, 2021/05/16
- [elpa] externals/org 88fbe21 01/41: Add Luc Pellissier as maintainer for two ob-* files, ELPA Syncer, 2021/05/16
- [elpa] externals/org dd88356 06/41: lisp/org-inlinetask.el: Silent the byte-compiler, ELPA Syncer, 2021/05/16
- [elpa] externals/org 5a0f6c9 07/41: lisp/ox-md.el: Mark some arguments as unused, ELPA Syncer, 2021/05/16
- [elpa] externals/org 99d873b 12/41: lisp/org.el: Fix indenting of planning line, ELPA Syncer, 2021/05/16
- [elpa] externals/org 3f59ea9 20/41: Add a test for known bug in org-element-cache, ELPA Syncer, 2021/05/16
- [elpa] externals/org b183315 21/41: Set org-adapt-indentation explicitly in some tests, ELPA Syncer, 2021/05/16
- [elpa] externals/org 33027f9 17/41: New command `org-refile-reverse' bound to C-c C-M-w, ELPA Syncer, 2021/05/16
- [elpa] externals/org e53572e 18/41: Fix code typo in 06c064e9, ELPA Syncer, 2021/05/16
- [elpa] externals/org c6d1150 19/41: Fix code typo in 06c064e9 (take 2), ELPA Syncer, 2021/05/16
- [elpa] externals/org f0447de 22/41: Set org-adapt-indentation explicitly in some tests,
ELPA Syncer <=
- [elpa] externals/org cbc450d 31/41: lisp/org-list.el: Fix bug wrt updating statistics, ELPA Syncer, 2021/05/16
- [elpa] externals/org 81c7a2d 23/41: lisp/org-agenda.el: Use "09:00" instead of " 9:00", ELPA Syncer, 2021/05/16
- [elpa] externals/org 72894cd 24/41: Allow moving inlinetasks using org-metaup/down, ELPA Syncer, 2021/05/16
- [elpa] externals/org c77066d 32/41: etc/ORG-NEWS: Add a news entry about ditaa.jar not being bundled, ELPA Syncer, 2021/05/16
- [elpa] externals/org f63cbd3 34/41: lisp/org.el: Fix bug in `org-sort-remove-invisible', ELPA Syncer, 2021/05/16
- [elpa] externals/org 8f39743 16/41: Use cache in org-up-heading-safe, ELPA Syncer, 2021/05/16
- [elpa] externals/org 83ab852 27/41: etc/ORG-NEWS: Various enhancements, ELPA Syncer, 2021/05/16
- [elpa] externals/org ee40458 25/41: lisp/ox-latex.el: Allow arbitrary float environments, ELPA Syncer, 2021/05/16
- [elpa] externals/org 336efd6 37/41: lisp/*: Use version number when obsoleting, ELPA Syncer, 2021/05/16
- [elpa] externals/org fdd7072 38/41: Merge branch 'master' of code.orgmode.org:bzg/org-mode, ELPA Syncer, 2021/05/16