1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
%%
%% This is file `qstest-qs.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% qstest.dtx (with options: `test,etex')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from qstest-qs.tex.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file qstest.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\errorcontextlines=\maxdimen
%%
%% Copyright (C) 2006, 2007 QuinScape GmbH
%% http://www.quinscape.de
\RequirePackage{qstest}
\LogTests{lgout}{*}{*}
\begin{qstest}{# in isolation}{\Expect, #, \unexpanded}
\toks0{# and #}
\Expect*{\the\toks0}*{\unexpanded{# and #}}
\end{qstest}
\begin{qstest}{# in isolation 2}{\Expect, #, \string}
\toks0{# and #}
\Expect*{\the\toks0}*{\string#\string# and \string#\string#}
\end{qstest}
\begin{qstest}{# as macro parameter}{\Expect, #}
\toks0{\def\xxx#1{}}
\Expect\expandafter{\the\toks0}{\def\xxx#1{}}
\end{qstest}
\makeatletter
\begin{qstest}{Some LaTeX definitions}{\Expect}
\Expect*{\meaning\@gobble}{\long macro:#1->}
\Expect*{\the\maxdimen}{16383.99998pt}
\end{qstest}
\RequirePackage{ifthen}
\begin{qstest}{\ExpectIfThen}{\ExpectIfThen}
\ExpectIfThen{\lengthtest{\maxdimen=16383.99998pt}\AND
\maxdimen>1000000000}
\end{qstest}
\begin{qstest}{\InRange success}{\InRange}
\dimen@=10pt
\Expect*{\the\dimen@}\InRange{5pt}{15pt}
\Expect*{\the\dimen@}\InRange{10pt}{15pt}
\Expect*{\the\dimen@}\InRange{5pt}{10pt}
\end{qstest}
\begin{qstest}{\InRange failure}{\InRange, fails}
\dimen@=10pt \dimen@ii=9.99998pt
\Expect*{\the\dimen@}\InRange{5pt}{\dimen@ii}
\dimen@ii=10.00002pt
\Expect*{\the\dimen@}*\InRange{\the\dimen@ii}{15pt}
\end{qstest}
\begin{qstest}{\NearTo success}{\NearTo}
\dimen@=10pt
\Expect*{\the\dimen@}\NearTo{10.05pt}
\Expect*{\the\dimen@}\NearTo{9.95pt}
\Expect*{\the\dimen@}\NearTo[2pt]{12pt}
\Expect*{\the\dimen@}\NearTo[0.1pt]{9.9pt}
\end{qstest}
\begin{qstest}{\NearTo failure}{\NearTo, fails}
\dimen@=10pt
\Expect*{\the\dimen@}\NearTo{10.05002pt}
\Expect*{\the\dimen@}\NearTo[1pt]{11.00001pt}
\end{qstest}
\begin{qstest}{\SavedValue}{\SavedValue}
\SaveValueFile{\jobname.qsout}
\SaveValue{\InternalSetValue}*{\meaning\InternalSetValue}
\SaveValue{\IncludeTests}*{\meaning\IncludeTests}
\SaveValue{whatever}*{3.1415}
\SaveValue{\maxdimen}*{\the\maxdimen}
\Expect{Whatever}\SavedValue{\InternalSetValue}
\Expect[\IncludeTests]{Whatever else}\SavedValue{\IncludeTests}
\Expect[whatever]{2.71828}\SavedValue{whatever}
\Expect[undefined]{1.618034}\SavedValue{undefined}
\CloseValueFile
\input{\jobname.qsout}
\Expect*{\meaning\InternalSetValue}\SavedValue{\InternalSetValue}
\Expect[\IncludeTests]*{\meaning\IncludeTests}%
\SavedValue{\IncludeTests}
\Expect[whatever]{3.1415}\SavedValue{whatever}
\Expect[undefined]{1.618034}\SavedValue{undefined}
\end{qstest}
\begin{qstest}{\SavedValue failure}{\SavedValue,fails}
\Expect{Whatever}\SavedValue{\InternalSetValue}
\Expect[\IncludeTests]{Whatever else}\SavedValue{\IncludeTests}
\Expect{2.71828}\SavedValue{whatever}
\end{qstest}
\begin{qstest}{ExpectCallSequence}{ExpectCallSequence}
\def\e{e} \def\f{f}
\def\g{g} \def\h{h}
\begin{ExpectCallSequence}{`\e#1{%
\Expect\expandafter{\csname\CalledName#1\endcsname}{\e }%
\Expect*{\meaning#1}{macro:->e}}+\f#1{}'}
\e \e \e \e \f
\end{ExpectCallSequence}
\end{qstest}
\LogClose{lgout}
\IncludeTests{*}
\makeatletter
\begin{qstest}{\LogClose}{}
\begin{ExpectCallSequence}{%
`\PackageInfo#1#2#3{\Expect[##1]{#2}{qstest}%
\Expect[##2]{#3}{Logging off: \jobname.log}%
#1{#2}{#3}}'}
\LogClose{log}
\end{ExpectCallSequence}
\end{qstest}
\begin{qstest}{\LogTests}{}
\begin{ExpectCallSequence}{%
\PackageInfo#1#2#3{\Expect[##1]{#2}{qstest}%
\Expect[##2]{#3}{Logging on: \jobname.log}%
#1{#2}{#3}}}
\LogTests{log}{*}{*}
\end{ExpectCallSequence}
\end{qstest}
\begin{qstest}{ExpectCallSequence state machine}%
{ExpectCallSequence,internal}
\def\foo#1#2#3{\relax\relax}
\let\fie\relax
\Expect*{\qst@csallocstate}{3}
\Expect*{\qst@csalloctrans}{2}
\begin{ExpectCallSequence}{\fie{}%
`\foo#1#2#3{#2\bar{#3}}(\bar#1#2{#2}|.#1{})+%
\foo#1{}}
\Expect*{\qst@csstate}{7}
\Expect*{\qst@csallocstate}{15}
\foo{\Expect*{\qst@csstate}{8}}{\Expect*{\qst@csstate}{10}}
\Expect*{\qst@csstate}{10}
\fie
\Expect*{\qst@csstate}{12}
\foo
\Expect*{\qst@csstate}{14}
\fie
\Expect*{\qst@csstate}{0}
\Expect*{\meaning\fie}*{\meaning\relax}
\foo\junk\junk\junk
\Expect*{\qst@csstate}{0}
\Expect*{\meaning\foo}{macro:#1#2#3->\relax \relax}
\end{ExpectCallSequence}
\end{qstest}
\stop
\endinput
%%
%% End of file `qstest-qs.tex'.
|