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

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

[elpa] externals/auctex ac02ed2 02/57: Extend test for new column counti


From: Tassilo Horn
Subject: [elpa] externals/auctex ac02ed2 02/57: Extend test for new column counting code with style files loaded
Date: Wed, 11 Jan 2017 18:01:37 +0000 (UTC)

branch: externals/auctex
commit ac02ed24635e988f65d0ca84b084f5a9f10680dd
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    Extend test for new column counting code with style files loaded
    
    * tests/latex/tabular-count-ampersands-out.tex:
    * tests/latex/tabular-count-ampersands-in.tex: Add tests for
    tabularx, tabulary, longtable, dcolumn, siunitx constructs.
    
    * tests/latex/latex-test.el
    (LaTeX-count-ampersands-inserted-in-tabular): Set `TeX-parse-self'
    to t in order to load style files in the test.  Thanks to Mosè
    Giordano for enabling this feature.
---
 tests/latex/latex-test.el                    |    4 +-
 tests/latex/tabular-count-ampersands-in.tex  |   50 +++++++++++++++++++++-
 tests/latex/tabular-count-ampersands-out.tex |   59 +++++++++++++++++++++++++-
 3 files changed, 110 insertions(+), 3 deletions(-)

diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el
index e8d8900..205af00 100644
--- a/tests/latex/latex-test.el
+++ b/tests/latex/latex-test.el
@@ -118,11 +118,13 @@ line and from another directory."
              (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.
+;; Following styles are loaded: tabularx, tabulary, longtable,
+;; dcolumn, siunitx
 (ert-deftest LaTeX-count-ampersands-inserted-in-tabular ()
   (should (string=
           (with-temp-buffer
             (insert-file-contents tabular-count-ampersands/in)
+            (setq TeX-parse-self t)
             (LaTeX-mode)
             (goto-char (point-min))
             ;; Do not ask for opt. argument in (TeX-insert-macro "\\"):
diff --git a/tests/latex/tabular-count-ampersands-in.tex 
b/tests/latex/tabular-count-ampersands-in.tex
index 97bc5f8..28c9bc6 100644
--- a/tests/latex/tabular-count-ampersands-in.tex
+++ b/tests/latex/tabular-count-ampersands-in.tex
@@ -1,5 +1,5 @@
 \documentclass{article}
-% \usepackage{tabularx,tabulary,longtable}
+\usepackage{tabularx,tabulary,longtable,dcolumn,siunitx}
 \begin{document}
 
 Standard LaTeX tabular:
@@ -33,4 +33,52 @@ Standard LaTeX tabular*:
   1 & 2 & 3 & LaTeX-insert-item
 \end{tabular*}
 
+tabularx:
+\begin{tabularx}{1.0\linewidth}{llX}
+  1 & 2 & LaTeX-insert-item
+\end{tabularx}
+
address@hidden>{\tiny\hfill}l<address@hidden
+  1 & 2 & LaTeX-insert-item
+\end{tabularx}
+
+\begin{tabularx}{1.0\linewidth}[t]{*{3}{|>{\tiny\hfill}X<{\hfill}}l}
+  1 & 2 & 3 & LaTeX-insert-item
+\end{tabularx}
+
+longtable:
+\begin{longtable}[l]{llr}
+  \caption{Some caption}\\
+  1 & 2 & LaTeX-insert-item
+\end{longtable}
+
+\begin{longtable}[c]{*{3}{l}r}
+  \caption{Some caption}\\
+  1 & 2 & 3 & LaTeX-insert-item
+\end{longtable}
+
+\begin{longtable}[r]{*{3}{lc*{2}{l}} r}
+  \caption{Some caption}\\
+  1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & LaTeX-insert-item
+\end{longtable}
+
+dcolumn:
+\begin{tabular}{D{,}{,}{2}D{,}{,}{2}D{,}{,}{2}}
+  1 & 2 & LaTeX-insert-item
+\end{tabular}
+
+\begin{tabular}{*{3}{D{,}{,}{2}}}
+  1 & 2 & LaTeX-insert-item
+\end{tabular}
+
+siunitx:
+\begin{tabular}{%
+  s
+  S[table-number-alignment = center]
+  s[table-number-alignment = left]
+  S[table-number-alignment = right]
+  }
+  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
index 1163637..add9fd8 100644
--- a/tests/latex/tabular-count-ampersands-out.tex
+++ b/tests/latex/tabular-count-ampersands-out.tex
@@ -1,5 +1,5 @@
 \documentclass{article}
-% \usepackage{tabularx,tabulary,longtable}
+\usepackage{tabularx,tabulary,longtable,dcolumn,siunitx}
 \begin{document}
 
 Standard LaTeX tabular:
@@ -40,4 +40,61 @@ Standard LaTeX tabular*:
     &&&
 \end{tabular*}
 
+tabularx:
+\begin{tabularx}{1.0\linewidth}{llX}
+  1 & 2 & LaTeX-insert-item \\
+    &&
+\end{tabularx}
+
address@hidden>{\tiny\hfill}l<address@hidden
+  1 & 2 & LaTeX-insert-item \\
+    &&
+\end{tabularx}
+
+\begin{tabularx}{1.0\linewidth}[t]{*{3}{|>{\tiny\hfill}X<{\hfill}}l}
+  1 & 2 & 3 & LaTeX-insert-item \\
+    &&&
+\end{tabularx}
+
+longtable:
+\begin{longtable}[l]{llr}
+  \caption{Some caption}\\
+  1 & 2 & LaTeX-insert-item \\
+    &&
+\end{longtable}
+
+\begin{longtable}[c]{*{3}{l}r}
+  \caption{Some caption}\\
+  1 & 2 & 3 & LaTeX-insert-item \\
+    &&&
+\end{longtable}
+
+\begin{longtable}[r]{*{3}{lc*{2}{l}} r}
+  \caption{Some caption}\\
+  1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & LaTeX-insert-item \\
+    &&&&&&&&&&&&
+\end{longtable}
+
+dcolumn:
+\begin{tabular}{D{,}{,}{2}D{,}{,}{2}D{,}{,}{2}}
+  1 & 2 & LaTeX-insert-item \\
+    &&
+\end{tabular}
+
+\begin{tabular}{*{3}{D{,}{,}{2}}}
+  1 & 2 & LaTeX-insert-item \\
+    &&
+\end{tabular}
+
+siunitx:
+\begin{tabular}{%
+  s
+  S[table-number-alignment = center]
+  s[table-number-alignment = left]
+  S[table-number-alignment = right]
+  }
+  1 & 2 & 3 & LaTeX-insert-item \\
+    &&&
+\end{tabular}
+
 \end{document}



reply via email to

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