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