[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 464fd34 20/71: * tests/latex/latex-test.el (LaTe
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 464fd34 20/71: * tests/latex/latex-test.el (LaTeX-flush-left-indent): New test. |
Date: |
Fri, 17 Dec 2021 15:00:28 -0500 (EST) |
branch: externals/auctex
commit 464fd346b9834ed1481c3c2ffa81963714fc530f
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
* tests/latex/latex-test.el (LaTeX-flush-left-indent): New test.
---
tests/latex/latex-test.el | 52 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index af6e34f..b6135b2 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -75,6 +75,58 @@
(insert-file-contents LaTeX-math-indent/out)
(buffer-string)))))
+;; Test for flush-left type indentation. The begin/end line of
+;; verbatim-like environments and comment-like environments (provided
+;; by comment.sty) must be flush left.
+;; We also test the indent inside these environments and after them.
+(ert-deftest LaTeX-flush-left-indent ()
+ (with-temp-buffer
+ (LaTeX-mode)
+ (let ((LaTeX-verbatim-environments
+ '("verbatim" "verbatim*" "filecontents" "filecontents*"))
+ (LaTeX-comment-env-list '("comment")))
+
+ ;; Test 1: verbatim environment
+ (insert "\
+\\begin{itemize}
+\\item abc")
+ (LaTeX-insert-environment "verbatim")
+ ;; Check indent inside verbatim env.
+ (should (= (current-column) 0))
+ ;; Check indent of verbatim env itself.
+ (should (string= "\
+\\begin{itemize}
+\\item abc
+\\begin{verbatim}
+
+\\end{verbatim}"
+ (buffer-string)))
+ ;; Check indent after verbatim env.
+ (goto-char (point-max))
+ (newline-and-indent)
+ (should (= (current-column) 2))
+
+ ;; Test 2: comment environment
+ (erase-buffer)
+ (insert "\
+\\begin{itemize}
+\\item abc")
+ (LaTeX-insert-environment "comment")
+ ;; Check indent inside comment env.
+ (should (= (current-column) 2))
+ ;; Check indent of comment env itself.
+ (should (string= "\
+\\begin{itemize}
+\\item abc
+\\begin{comment}
+\s\s
+\\end{comment}"
+ (buffer-string)))
+ ;; Check indent after comment env.
+ (goto-char (point-max))
+ (newline-and-indent)
+ (should (= (current-column) 2)))))
+
;; Test LaTeX code with math modes is indented as expected. This has mostly to
;; do with the value of `LaTeX-fill-break-at-separators' and how
;; `LaTeX-fill-move-to-break-point' handles it. If the test fails, try to look
- [elpa] externals/auctex 9284ac6 22/71: Explain how to do forward search by mouse, (continued)
- [elpa] externals/auctex 9284ac6 22/71: Explain how to do forward search by mouse, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 363b778 56/71: Update style/multicol.el to package version 1.9b, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 22e4415 68/71: Add styles for packages from sttools collection, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex b866110 31/71: Autoload `TeX-check-engine-add-engines' in tex.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 0322057 55/71: Fix misc minor issues, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 9f3e760 10/71: Recognize L3 \msg_line_context: on warning parsing, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 44a8a42 09/71: ; Don't use `assoc-delete-all', Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 0c01b75 13/71: ; * doc/changes.texi: Fix a markup., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex fd73414 11/71: ; * doc/changes.texi: Add supplementary notice., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 7fa094f 14/71: ; * style/tabulary.el ("tabulary"): Really append the entry., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 464fd34 20/71: * tests/latex/latex-test.el (LaTeX-flush-left-indent): New test.,
Tassilo Horn <=
- [elpa] externals/auctex ae2d7ef 23/71: Silence compiler warning, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex f6dd4a4 25/71: ; Silence the compiler, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex df0d719 52/71: Improve handling of key=vals in style/hologo.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 08f5c9e 51/71: Improve handling of key=vals in style/floatrow.el, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 9fa3859 38/71: ; Remove duplicates, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 7b632c6 43/71: * doc/todo.texi (Mid-term Goals): Add TODO about tool bar., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex b379da7 18/71: Don't indent begin/end of comment env, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 483f6e9 05/71: ; * style/hyperref.el ("hyperref"): Fix other link to testform.tex., Tassilo Horn, 2021/12/17
- [elpa] externals/auctex 380bc4a 06/71: Handle optional embellishment arguments correctly, Tassilo Horn, 2021/12/17
- [elpa] externals/auctex bd723c7 24/71: Cater for corner case when dealing with TeX error, Tassilo Horn, 2021/12/17