diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/oberdiek/test/luatex-test4.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/oberdiek/test/luatex-test4.tex | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/oberdiek/test/luatex-test4.tex b/Master/texmf-dist/doc/latex/oberdiek/test/luatex-test4.tex new file mode 100644 index 00000000000..46af65dcc47 --- /dev/null +++ b/Master/texmf-dist/doc/latex/oberdiek/test/luatex-test4.tex @@ -0,0 +1,185 @@ +%% +%% This is file `luatex-test4.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% luatex.dtx (with options: `test4') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% This work consists of the main source file luatex.dtx +%% and the derived files +%% luatex.sty, luatex.pdf, luatex.ins, luatex.drv, luatex-loader.sty, +%% luatex-test1.tex, luatex-test2.tex, luatex-test3.tex, +%% luatex-test4.tex, luatex-test5.tex, oberdiek.luatex.lua. +%% +\NeedsTeXFormat{LaTeX2e} +\count0=0 % +\chardef\TestLaTeX=1000 % +\chardef\TestMax=300 % +\loop + \count\numexpr\TestLaTeX+\count0\relax=\catcode\count0 % +\ifnum\count0<\TestMax + \advance\count0 by 1 % +\repeat +\documentclass{minimal} +\usepackage{luatex}[2007/12/12] +\usepackage{qstest} +\IncludeTests{*} +\LogTests{log}{*}{*} +\makeatletter +\def\Check#1{% + \Expect*{\the\count@=\the\catcode\count@}% + *{\the\count@=#1}% +} +\newcount\scratch +\def\Test#1#2{% + \begin{qstest}{CatcodeTable#1}{CatcodeTable#1}% + \catcodetable\csname CatcodeTable#1\endcsname + \count@=\z@ + \loop + \scratch=#2\relax + \Expect*{\the\count@=\the\catcode\count@}% + *{\the\count@=\the\scratch}% + \ifnum\count@<\TestMax + \advance\count@\@ne + \repeat + \end{qstest}% +} +\Test{LaTeX}{\the\count\numexpr\TestLaTeX+\count@} +\Test{String}{\ifnum\count@=32 10\else 12\fi} +\Test{Other}{12} +\initcatcodetable99 % +\Test{IniTeX}{% + 0\relax + \begingroup + \catcodetable99 % + \global\scratch=\the\catcode\count@ + \endgroup +} +\begin{qstest}{CatcodeTableNumStack}{CatcodeTableNumStack} + \def\TestStack#1{% + \Expect*{\LuT@NumStack}{#1}% + }% + \TestStack{0}% + \PushCatcodeTableNumStack + \TestStack{{0}0}% + \@firstofone{% + \begingroup + \initcatcodetable12 % + \catcodetable12 % + \PushCatcodeTableNumStack + \TestStack{{12}{0}0}% + \PopCatcodeTableNumStack + \TestStack{{0}0}% + \PopCatcodeTableNumStack + \TestStack{0}% + \def\TestWarning{Missing empty stack warning}% + \def\@PackageWarning#1#2{\def\TestWarning{empty stack}}% + \PopCatcodeTableNumStack + \TestStack{0}% + \Expect*{\TestWarning}{empty stack}% + \endgroup + }% +\end{qstest} +\begin{qstest}{CatcodeTableStack}{CatcodeTableStack} + \def\TestStack#1{% + \Expect*{\the\CatcodeTableStack}{#1}% + }% + \TestStack{0}% + \IncCatcodeTableStack + \TestStack{2}% + \IncCatcodeTableStack + \TestStack{4}% + \begingroup + \IncCatcodeTableStack + \TestStack{6}% + \endgroup + \TestStack{6}% + \begingroup + \DecCatcodeTableStack + \TestStack{4}% + \endgroup + \TestStack{4}% + \DecCatcodeTableStack + \TestStack{2}% + \DecCatcodeTableStack + \TestStack{0}% + \begingroup + \def\TestError{Missing error}% + \def\@PackageError#1#2#3{% + \def\TestError{Empty stack}% + }% + \DecCatcodeTableStack + \TestStack{0}% + \Expect*{\TestError}{Empty stack}% + \endgroup +\end{qstest} +\begin{qstest}{CatcodeRegime}{CatcodeRegime} + \def\TestStacks#1#2#3{% + \Expect*{\the\catcodetable}{#1}% + \Expect*{\the\CatcodeTableStack}{#2}% + \Expect*{\LuT@NumStack}{#3}% + }% + \TestStacks{0}{0}{0}% + \catcode`\|=7 % + \BeginCatcodeRegime\CatcodeTableLaTeX + \TestStacks{2}{2}{{0}0}% + \Expect*{\the\catcode`\|}{12}% + \EndCatcodeRegime + \TestStacks{0}{0}{0}% + \Expect*{\the\catcode`\|}{7}% +\end{qstest} +\begin{qstest}{Attributes}{Attributes} + \newattribute\TestAttr + \Expect*{\meaning\TestAttr}% + *{\string\attribute\number\allocationnumber}% + \Expect*{\the\allocationnumber}{0}% + \begingroup + \newattribute\TestAttr + \Expect*{\the\allocationnumber}{1}% + \endgroup + \Expect*{\the\allocationnumber}{0}% + \Expect*{\meaning\TestAttr}*{\string\attribute1}% + \Expect*{\the\TestAttr}{-1}% + \def\Test#1{% + \setattribute\TestAttr{#1}% + \Expect*{\the\TestAttr}{#1}% + }% + \Test{0}% + \Test{1}% + \Test{-1}% + \Test{123}% + \unsetattribute\TestAttr + \Expect*{\the\TestAttr}{-1}% + \begingroup + \Expect*{\the\TestAttr}{-1}% + \Test{1234}% + \endgroup + \Expect*{\the\TestAttr}{-1}% +\end{qstest} +\begin{qstest}{LuaState}{LuaState} + \newluastate\TestLuaState + \Expect*{\number\TestLuaState}{1}% + \newluastate\TestLuaState + \Expect*{\number\TestLuaState}{2}% +\end{qstest} +\@@end +\endinput +%% +%% End of file `luatex-test4.tex'. |