def test_let_redef(): compare_output(r''' \newcommand\foo{a} \let\bar\foo \renewcommand\foo{b} \bar ''')
def test_let_nonrecursive(): compare_output(r''' \newcommand\foo{a} \newcommand\fooo{\foo} \let\bar\fooo \renewcommand\foo{b} \bar ''')
def test_let_scope(): compare_output(r''' { \let\foo=a \foo% }% \let\foo=b% \foo ''')
def testNewcommand(self): compare_output( r'\newcommand\mycommand[2][optional]{\itshape{#1:#2}}\newcommand{ \foo }{{this is foo}}\mycommand[hi]{{\foo}!!!}' )
def testDef3(self): compare_output(r'\def\foo#1#2{:#1:#2:}\foo x y')
def testNewIfIf(self): compare_output( r'before \iffalse never \else always \newif \iffoobar \foobartrue \fi then \iffoobar one\else two\fi allend' )
def testIfCase(self): compare_output(r'\ifcase 2 bye\or text\or one\else two\fi')
def testIfTrue(self): compare_output(r'\iftrue bye\else text\fi\iftrue one\else two\fi')
def testIfVBox(self): compare_output(r'\ifvbox12 bye\else text\fi\ifvbox16 one\else two\fi')
def testFalse(self): compare_output(r'\newif\iffoo\foofalse\iffoo hi\else bye\fi')
def testTrue(self): compare_output(r'\newif\iffoo\footrue\iffoo hi\else bye\fi')
def testIfHBox(): compare_output(r'\ifhbox12 bye\else text\fi\ifhbox16 one\else two\fi')
def testIfHMode(): compare_output(r'\ifhmode bye\else text\fi\ifhmode one\else two\fi')
def testNewIfIf(): compare_output( r'before \iftrue always \newif \iffoobar up \else down \fi then \iffoobar one \else two \fi allend' )
def testIfX(self): compare_output(r'\ifx!!bye\else text\fi\ifx!( one\else two\fi')
def testIf(self): compare_output(r'\if*! bye\else text\fi\if** one\else two\fi')
def testIfVoid(self): compare_output(r'\ifvoid12 bye\else text\fi\ifvoid16 one\else two\fi')
def testIfNum(self): compare_output( r'\ifnum 5 < 2 bye\else text\fi\ifnum 2 = 2 one\else two\fi')
def testIfEOF(self): compare_output(r'\ifeof12 bye\else text\fi\ifeof15 one\else two\fi')
def testIfDim(self): compare_output( r'\ifdim -5 pt > 2in bye\else text\fi\ifdim 2mm = 2 mm one\else two\fi' )
def testIfFalse(self): compare_output(r'\iffalse bye\else text\fi\iffalse one\else two\fi')
def testIfOdd(self): compare_output(r'\ifodd 2 bye\else text\fi\ifodd 3 one\else two\fi')
def testNestedIf2(self): compare_output( r'\ifnum 2 > 3 bye\iftrue text\ifcat() hi\fi\else one\fi\fi foo')
def testIfMMode(self): compare_output(r'\ifmmode bye\else text\fi\ifmmode one\else two\fi')
def testDef(self): compare_output( r'\def\mymacro#1#2;#3\endmacro{this #1 is #2 my #3 command}\mymacro{one}x;y\endmacro morestuff' )
def testIfInner(self): compare_output(r'\ifinner bye\else text\fi\ifinner one\else two\fi')
def testChardef(self): compare_output(r'\chardef\foo=65\relax\foo')
def testIfCat(self): compare_output(r'\ifcat!a bye\else text\fi\ifcat!( one\else two\fi')
def testRedefineUndefinedCommand(self): compare_output(r'\let\bar\foo\newcommand\foo{Foo}\foo')
def test_expandafter_undefined(): compare_output(r'\def\xx{\yy}\expandafter\def\xx{a}\yy')