# Defines simple single-line tests that should result in errors.
#
# When editing this file, ensure that it is encoded as UTF-8 since we test for
# certain non-ASCII characters here and don't want the encoding messed up!
#
# Input format is:
#
# LaTeX line
# Expected error codes, separated by ','
# ==== (divider)
#
# Lines starting with '#' are documentation and are stripped out when running tests.
#
# For convenience, the characters '%n' in the LaTeX input will be treated as a newline,
# thus allowing very basic multi-line inputs to be emulated.
#
# Also %unnnn is treated as a Unicode character (16 bit max).
#
# You can use '...' to denote 'any other stuff' at the end of your list of error codes,
# which is useful in the cases where a certain type of error will trigger a few others.
#
###################################################################
### Simple tests created to trigger each explicit error code
{
TTEG00
====
\
TTEG01
====
# C1 control characters. They're legal in XML but we're not going to allow them.
%u0080
TTEG02
====
%u0000
TTEG02
====
%u007F
TTEG02
====
\]
TTEG03
====
Blah #
TTEG04
====
# Lonely high surrogate
%uD800
TTEG05
====
# Lonely low surrogate
%uDC00
TTEG05
====
# Bad surrogate pair
%uDC00%uD800
TTEG05...
====
$\[a$
TTEM00
====
$x$$
TTEM01
====
\[ x \)
TTEG03...
====
^
TTEM03
====
$$ $ $$
TTEM04
====
\( $ \)
TTEM04
====
\[ $ \]
TTEM04
====
\verb x
TTEV00
====
\verb|x %n Can't span newlines! |
TTEV01
====
\verb|
TTEG00
====
# Regression: Bug 2926914
\verb|%n
TTEG00,TTEV01
====
# NB: This one changed in revision 69 after generalising how verbatim arguments work
\verb|Hello
TTEG00
====
\susan
TTEC00
====
\alpha
TTEC01
====
$\frac{x} + 4$
TTEC02
====
$\frac{x}$
TTEC02
====
$\not$
TTEC03
====
$\not\mbox{a}$
TTEC04
====
\begin{itemize}\item \end{verbatim}\end{itemize}
TTEE00
====
\begin A
TTEE01
====
\begin{bob}
TTEE02
====
$\begin{itemize}\end{itemize}$
TTEE03
====
\begin{itemize}
TTEE04
====
\end{itemize}
TTEE05
====
\begin{xmlBlockElement}\end{xmlBlockElement}
TTEE06
====
\newcommand
TTEUC0
====
\newcommand{susan}{Hello}
TTEUC1
====
\newcommand X
TTEUC1
====
\newcommand{\susan}{Never-ending...
TTEUC2
====
\newcommand{\susan}
TTEUC3
====
\renewcommand{\susan}{Hello}
TTEUC4
====
\newcommand{\alpha}{\beta}
TTEUC5
====
\newcommand{\susan Hello}
TTEUC6
====
\newcommand{\susan}[a]{Oh dear}
TTEUC7
====
\newcommand{\(}{Hello}
TTEUC8
====
\newcommand{\test}[Square bracket not closed
TTEUC9
====
## Recursive command
\newcommand{\test}{\test} \test
TTEU00
====
## Recursive command 2
\newcommand{\test}{Head \test} \test
TTEU00
====
## Recursive command 3
\newcommand{\bob}{\susan} \newcommand{\susan}{\bob} \bob
TTEU00
====
## Recursive environment
\newenvironment{x}{\begin{x}}{}\begin{x}\end{x}
TTEU00...
====
## Regression: check of out-of-range parameter numbers was too lazy through to 1.2.1
\newcommand{\bob}[1]{Hello #2}\bob{x}
TTEUCA,TTEC00
====
\newcommand{\bob}{Hello #}\bob
TTEUCA,TTEC00
====
\newenvironment
TTEUE0
====
\newenvironment{susan}
TTEUE1
====
\newenvironment{susan}{Start}
TTEUE1
====
\renewenvironment{susan}{Start}{End}
TTEUE2
====
\newenvironment{itemize}{Start}{End}
TTEUE3
====
## Regression similar to TTEUCA
\newenvironment{x}[1]{#2}{}\begin{x}\end{x}
TTEUE5...
====
## Regression: partner of TTEUE5
\newenvironment{x}{}{#1}\begin{x}\end{x}
TTEUE6...
====
\begin{itemize}Hello\end{itemize}
TFEL00
====
\mbox{\xmlBlockElement{a}{b}{c}}
TFEG00
====
$1 \over 2 \over 3$
TFEM00
====
$1_$
TFEM01
====
$1^$
TFEM01
====
$x_1_2$
TFEM02
====
$\right)$
TFEM03
====
$\left($
TFEM04
====
\begin{tabular}{c} Hello \hline \end{tabular}
TFETB0
====
&
TDEG00
====
\xmlBlockElement[hello]{urn:ns}{qName}{Content}
TDEX00
====
\xmlBlockElement{urn:ns}{x,1}{Content}
TDEX01
====
\xmlAttr{urn:ns}{qName}{value}
TDEX02
====
\xmlName{0}
TDEX03
====
\href{ }
TDEX04
====
\xmlBlockElement{\literal|%|}{qName}{Content}
TDEX04
====
\anchor{id}\anchor{id}
TDEX05
====
\ux{G}
TDEXU0
====
\ux{FFFFFF}
TDEXU1
====
\item A
TDEL00
====
\begin{eqnarray*} 1 & 2 & 3 & 4 \end{eqnarray*}
TDEM01
====
$\begin{array}{x} 1 \end{array}$
TDEMA0
====
$\begin{array}{} \end{array}$
TDEMA1
====
$\begin{array}{c} 1&2 \end{array}$
TDEMA2
====
$\begin{cases} 1&2&3 \end{cases}$
TDEMM0
====
\'{\mbox{a}}
TDETA0
====
\'{}
TDETA1
====
\'{b}
TDETA2
====
\begin{tabular}{c} 1 & 2 \end{tabular}
TDETB0
====
\begin{tabular}{cx} 1 \end{tabular}
TDETB1
====
\begin{tabular}{} \end{tabular}
TDETB2
====
\hspace*{a}
TDEUN0
====
\hspace*{1.2.5 cm}
TDEUN1
====
\hspace*{1 xx}
TDEUN2
====
###################################################################
## Extra error examples... add new and interesting cases here when found
$}
TTEG00
====
$
TTEG00
====
\begin{verbatim}Hello
TTEG00
====
# See TTEM01, though this is different.
$$x$
TTEM04,TTEG00
====
\newcommand{\test}{\begin{itemize}}\test
TTEE04
====
\newcommand{\test}{\begin{bob}}\test
TTEE02
====
\newenvironment{test}{\bad}{You}\begin{test}Hello\end{test}
TTEC00
====
\newcommand{}{Hello}
TTEUC1
====
\newcommand\
TTEUC0
====
\newcommand{\
TTEUC0
====
\newcommand{\test}[1][Never closed....
TTEUC9
====
\newcommand{\test}[1][]{#1}\test[
TTEG00
====
\newcommand{\test}[1]{\sin #1}\test{
TTEG00
====
\newenvironment{test}{Start}{End}\begin{test}
TTEE04
====
\renewcommand{\begin}{end}
TTEUC8
====
\newenvironment{}{}{}
TTEUE0
====
\( x \]
TTEG03...
====
$#$
TTEG04
====
## Regression: this was causing an Exception before but should now give a client error
$\mbox^$
TTEM03
====
## Regression: This was causing an NPE
${\mathrm}{x}$
TTEC02...
====
## This one behaves differently from LaTeX, which continues with no error and skips the '$' characters
\( $$ \)
TTEM04...
====
