[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 66ed2ac 30/36: Add test for new c
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 66ed2ac 30/36: Add test for new column counting code |
Date: |
Thu, 22 Dec 2016 13:08:13 +0000 (UTC) |
branch: externals/auctex
commit 66ed2ac0732d0a0af1045091fb24535ac5d3bdbf
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Add test for new column counting code
* tests/latex/tabular-count-ampersands-out.tex:
* tests/latex/tabular-count-ampersands-in.tex: New files.
* tests/latex/latex-test.el
(LaTeX-count-ampersands-inserted-in-tabular): Test new column
counting code in `LaTeX-array-count-columns'.
---
tests/latex/latex-test.el | 26 ++++++++++++++--
tests/latex/tabular-count-ampersands-in.tex | 36 +++++++++++++++++++++
tests/latex/tabular-count-ampersands-out.tex | 43 ++++++++++++++++++++++++++
3 files changed, 103 insertions(+), 2 deletions(-)
diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index cc23caf..28af7b5 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -1,6 +1,6 @@
;;; latex-test.el --- tests for LaTeX mode
-;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2014--2016 Free Software Foundation, Inc.
;; This file is part of AUCTeX.
@@ -48,7 +48,11 @@ line and from another directory."
'LaTeX-math-indent/in
"math-indent-in.tex"
'LaTeX-math-indent/out
- "math-indent-out.tex")
+ "math-indent-out.tex"
+ 'tabular-count-ampersands/in
+ "tabular-count-ampersands-in.tex"
+ 'tabular-count-ampersands/out
+ "tabular-count-ampersands-out.tex")
(ert-deftest LaTeX-indent-tabular ()
(should (string=
@@ -106,4 +110,22 @@ line and from another directory."
(LaTeX-insert-environment "foobar")
(buffer-string)))))
+;; Test for inserting &'s with `M-RET' in various tabular environment.
+;; FIXME: One thing missing is running style hooks while running the test.
+(ert-deftest LaTeX-count-ampersands-inserted-in-tabular ()
+ (should (string=
+ (with-temp-buffer
+ (insert-file-contents tabular-count-ampersands/in)
+ (LaTeX-mode)
+ (goto-char (point-min))
+ ;; Do not ask for opt. argument in (TeX-insert-macro "\"):
+ (let ((TeX-insert-macro-default-style 'mandatory-args-only))
+ (while (search-forward "LaTeX-insert-item" nil t)
+ (LaTeX-insert-item)))
+ (buffer-string))
+ (with-temp-buffer
+ (insert-file-contents tabular-count-ampersands/out)
+ (LaTeX-mode)
+ (buffer-string)))))
+
;;; latex-test.el ends here
diff --git a/tests/latex/tabular-count-ampersands-in.tex
b/tests/latex/tabular-count-ampersands-in.tex
new file mode 100644
index 0000000..97bc5f8
--- /dev/null
+++ b/tests/latex/tabular-count-ampersands-in.tex
@@ -0,0 +1,36 @@
+\documentclass{article}
+% \usepackage{tabularx,tabulary,longtable}
+egin{document}
+
+Standard LaTeX tabular:
+egin{tabular}[t]{llll}
+ 1 & 2 & 3 & LaTeX-insert-item
+\end{tabular}
+
+LaTeX tabular with *-operator:
+egin{tabular}[t]{*{3}{l}r}
+ 1 & 2 & 3 & LaTeX-insert-item
+\end{tabular}
+
+egin{tabular}{*{3}{l}>{ iny\hfill}l<{\hfill}}
+ 1 & 2 & 3 & LaTeX-insert-item
+\end{tabular}
+
+egin{tabular}[t]{*{3}{lc}r}
+ 1 & 2 & 3 & 4 & 5 & 6 & LaTeX-insert-item
+\end{tabular}
+
+egin{tabular}[t]{*{3}{lc*{2}{l}} r}
+ 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & LaTeX-insert-item
+\end{tabular}
+
+Standard LaTeX tabular*:
address@hidden@{}}
+ 1 & 2 & 3 & LaTeX-insert-item
+\end{tabular*}
+
address@hidden|l}|r|}
+ 1 & 2 & 3 & LaTeX-insert-item
+\end{tabular*}
+
+\end{document}
diff --git a/tests/latex/tabular-count-ampersands-out.tex
b/tests/latex/tabular-count-ampersands-out.tex
new file mode 100644
index 0000000..1163637
--- /dev/null
+++ b/tests/latex/tabular-count-ampersands-out.tex
@@ -0,0 +1,43 @@
+\documentclass{article}
+% \usepackage{tabularx,tabulary,longtable}
+egin{document}
+
+Standard LaTeX tabular:
+egin{tabular}[t]{llll}
+ 1 & 2 & 3 & LaTeX-insert-item \
+ &&&
+\end{tabular}
+
+LaTeX tabular with *-operator:
+egin{tabular}[t]{*{3}{l}r}
+ 1 & 2 & 3 & LaTeX-insert-item \
+ &&&
+\end{tabular}
+
+egin{tabular}{*{3}{l}>{ iny\hfill}l<{\hfill}}
+ 1 & 2 & 3 & LaTeX-insert-item \
+ &&&
+\end{tabular}
+
+egin{tabular}[t]{*{3}{lc}r}
+ 1 & 2 & 3 & 4 & 5 & 6 & LaTeX-insert-item \
+ &&&&&&
+\end{tabular}
+
+egin{tabular}[t]{*{3}{lc*{2}{l}} r}
+ 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & LaTeX-insert-item \\
+ &&&&&&&&&&&&
+\end{tabular}
+
+Standard LaTeX tabular*:
address@hidden@{}}
+ 1 & 2 & 3 & LaTeX-insert-item \
+ &&&
+\end{tabular*}
+
address@hidden|l}|r|}
+ 1 & 2 & 3 & LaTeX-insert-item \
+ &&&
+\end{tabular*}
+
+\end{document}
- [AUCTeX-diffs] [elpa] externals/auctex updated (1b5875c -> 2e7ca50), Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 80d2a08 10/36: Min fix to kpfonts package, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 29ae5fb 15/36: Add \LTXtable to list of file-loading commands, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex eb748ea 18/36: Fix query for defined colors in style/ntheorem.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 7518a8a 31/36: Mention that arguments to *-operator must be in braces, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex e4aba95 21/36: Support RefTeX with `reftex-add-label-environments' in style/mathtools.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 66ed2ac 30/36: Add test for new column counting code,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex f04e5f7 09/36: Add style file for amsfonts package, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 1aa46c3 23/36: ; Use third argument of `TeX-argument-insert', Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 40da84e 20/36: Support RefTeX with `reftex-add-label-environments' in style/empheq.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex d6890e8 04/36: Improve caption and label insertion in style/subcaption.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex b44d524 35/36: Uniform font-lock updates/don't break prettify (bug#25245), Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 79c8264 19/36: Fix query for defined colors in style/textpos.el, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 8a14439 11/36: Add style file for subfiles package., Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 6ec185e 16/36: Do not spell-check arguments of \LTXtable, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 6a31d4e 14/36: Support new floats defined with newfloat package, Tassilo Horn, 2016/12/22
- [AUCTeX-diffs] [elpa] externals/auctex 42dd1f1 22/36: Support RefTeX with `reftex-add-index-macros' in style/splitidx.el, Tassilo Horn, 2016/12/22