Skip to content

Commit

Permalink
Add test which would have shown regression regarding table.colsep
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Aug 13, 2022
1 parent 3c4cb45 commit 9dd00ce
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/roots/test-latex-table/complex.rst
Expand Up @@ -20,6 +20,25 @@ grid table
| cell5-1 |
+---------+---------+---------+

grid table with tabularcolumns having no vline
----------------------------------------------

.. tabularcolumns:: TTT

+---------+---------+---------+
| header1 | header2 | header3 |
+=========+=========+=========+
| cell1-1 | cell1-2 | cell1-3 |
+---------+ +---------+
| cell2-1 | | cell2-3 |
+ +---------+---------+
| | cell3-2-par1 |
+---------+ |
| cell4-1 | cell3-2-par2 |
+---------+---------+---------+
| cell5-1 |
+---------+---------+---------+

complex spanning cell
---------------------

Expand Down
@@ -0,0 +1,73 @@
\label{\detokenize{complex:grid-table-with-tabularcolumns-having-no-vline}}

\begin{savenotes}\sphinxattablestart
\sphinxthistablewithglobalstyle
\sphinxthistablewithnovlinesstyle
\centering
\begin{tabulary}{\linewidth}[t]{TTT}
\sphinxtoprule
\sphinxstyletheadfamily
\sphinxAtStartPar
header1
&\sphinxstyletheadfamily
\sphinxAtStartPar
header2
&\sphinxstyletheadfamily
\sphinxAtStartPar
header3
\\
\sphinxmidrule
\sphinxtableatstartofbodyhook
\sphinxAtStartPar
cell1\sphinxhyphen{}1
&\sphinxmultirow{2}{5}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{3}}
\sphinxAtStartPar
cell1\sphinxhyphen{}2
\par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}%
&
\sphinxAtStartPar
cell1\sphinxhyphen{}3
\\
\sphinxcline{1-1}\sphinxcline{3-3}\sphinxmultirow{2}{7}{%
\begin{varwidth}[t]{\sphinxcolwidth{1}{3}}
\sphinxAtStartPar
cell2\sphinxhyphen{}1
\par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}%
&\sphinxtablestrut{5}&
\sphinxAtStartPar
cell2\sphinxhyphen{}3
\\
\sphinxcline{2-3}\sphinxtablestrut{7}&\sphinxstartmulticolumn{2}%
\sphinxmultirow{2}{9}{%
\begin{varwidth}[t]{\sphinxcolwidth{2}{3}}
\sphinxAtStartPar
cell3\sphinxhyphen{}2\sphinxhyphen{}par1

\sphinxAtStartPar
cell3\sphinxhyphen{}2\sphinxhyphen{}par2
\par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
}%
\sphinxstopmulticolumn
\\
\sphinxcline{1-1}
\sphinxAtStartPar
cell4\sphinxhyphen{}1
&\multicolumn{2}{l}{\sphinxtablestrut{9}}\\
\sphinxhline\sphinxstartmulticolumn{3}%
\begin{varwidth}[t]{\sphinxcolwidth{3}{3}}
\sphinxAtStartPar
cell5\sphinxhyphen{}1
\par
\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%
\sphinxstopmulticolumn
\\
\sphinxbottomrule
\end{tabulary}
\sphinxtableafterendhook\par
\sphinxattableend\end{savenotes}
7 changes: 7 additions & 0 deletions tests/test_build_latex.py
Expand Up @@ -1314,6 +1314,13 @@ def get_expected(name):
expected = get_expected('gridtable')
assert actual == expected

# grid table with tabularcolumns
# MEMO: filename should end with tabularcolumns but tabularcolumn has been
# used in existing other cases
actual = tables['grid table with tabularcolumns having no vline']
expected = get_expected('gridtable_with_tabularcolumn')
assert actual == expected

# complex spanning cell
actual = tables['complex spanning cell']
expected = get_expected('complex_spanning_cell')
Expand Down

0 comments on commit 9dd00ce

Please sign in to comment.