summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/qstest
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-02-26 01:15:02 +0000
committerKarl Berry <karl@freefriends.org>2007-02-26 01:15:02 +0000
commitaf0a12985674bb2c95947a4c9c439887b679f168 (patch)
treea19c338e27b62cbb17969095279a5885596e41f1 /Master/texmf-dist/doc/latex/qstest
parent4a0068129d6635fb71e1d030ac322a3ab55c45e1 (diff)
new latex package qstest (22feb07)
git-svn-id: svn://tug.org/texlive/trunk@3990 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/qstest')
-rw-r--r--Master/texmf-dist/doc/latex/qstest/README93
-rw-r--r--Master/texmf-dist/doc/latex/qstest/makematch-qs.tex102
-rw-r--r--Master/texmf-dist/doc/latex/qstest/makematch.pdfbin0 -> 101144 bytes
-rw-r--r--Master/texmf-dist/doc/latex/qstest/qstest-qs.tex155
-rw-r--r--Master/texmf-dist/doc/latex/qstest/qstest.pdfbin0 -> 159684 bytes
5 files changed, 350 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/qstest/README b/Master/texmf-dist/doc/latex/qstest/README
new file mode 100644
index 00000000000..74d9b8a412f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/qstest/README
@@ -0,0 +1,93 @@
+This is the public release of the qstest bundle
+(written for DocScape Publisher <URL:http://www.docscape.de>)
+(C) 2006, 2007 QuinScape GmbH <URL:http://www.quinscape.de>
+
+This software comes without warranty of any kind.
+
+The TeX source files are licensed under the LPPL version 1.3 or later,
+see the individual files for details. Generated files refer to the
+license of their respective source. Makefile and this README may be
+freely used, modified and copied.
+
+The bundle contains the packages `makematch' for matching patterns to
+targets (with a generalization in the form of pattern lists and
+keyword lists), and `qstest' for performing unit tests, allowing to
+run a number of logged tests ensuring the consistency of values,
+properties and call sequences during execution of test code. Both
+packages make extensive use of qstest in their package documentation,
+providing illustrated examples that are automatically verified to work
+as expected.
+
+For efficiency and feature completeness reasons, both styles require
+the use of an eTeX-based engine for LaTeX, as recommended by the LaTeX
+team for some years (while the source code provides a way of producing
+files for a non-eTeX setup, this is discouraged, untested, not feature
+complete, not supported by Makefile and author).
+
+Files in the bundle:
+
+Makefile: this contains rules for managing unpacking, testing, and
+installing the bundle in TDS-compliant trees. Interesting targets are
+all generated files, "test", and "install".
+
+qstest.ins: installer file. Running
+ tex qstest.ins
+will unpack the packages (but not their driver files) right into the
+target tree if your docstrip is configured for it. If you want to
+unpack into the current directory instead (and avoid getting asked
+whether you want to overwrite old files, as is desirable for working
+with the program `make'), you can do so by instead running
+ tex "\let\Make=y \input qstest.ins"
+Should qstest.ins be missing, you can use (or look at) the Makefile
+for regenerating it.
+
+makematch.dtx: documented source of makematch.sty. Running this
+document through LaTeX will give you the documentation of the package,
+but without the documented package source.
+
+qstest.dtx: documented source of qstest.sty. Running this document
+through LaTeX will give you the documentation of the package, but
+without the documented package source.
+
+
+The following files are also placed on CTAN for informational
+purposes; as part of a TeX installation it would usually be preferable
+to rather install DVI files with full source code listing, generated
+by running latex on the files of form *.drv (see below):
+
+qstest.pdf: the result of running PDFLaTeX on qstest.dtx, namely the
+documentation for the qstest package without source code listing.
+
+makematch.pdf: the result of running PDFLaTeX on qstest.dtx, namely
+the documentation for the makematch package without source code
+listing.
+
+
+The following files will be unpacked by qstest.ins:
+
+makematch.sty: this package matches pattern lists with wildcards to
+keyword lists.
+
+makematch.drv: this file can be run through LaTeX in order to generate
+the documentation for the makematch package including the full
+documented source code.
+
+qstest.sty: this package allows one to perform unit tests and check
+for values, definitions and macro call sequences to meet expectations.
+Call sequences are specified with a syntax reminiscent of regular
+expressions.
+
+qstest.drv: this file can be run through LaTeX in order to generate
+the documentation for the qstest package including the full documented
+source code.
+
+makematch-qs.tex: a standalone unit test of makematch.sty, to be run
+through LaTeX.
+
+qstest-qs.tex: a standalone unit test of qstest.sty, to be run
+through LaTeX.
+
+
+David Kastrup <dak@gnu.org>
+QuinScape GmbH
+http://www.QuinScape.de
diff --git a/Master/texmf-dist/doc/latex/qstest/makematch-qs.tex b/Master/texmf-dist/doc/latex/qstest/makematch-qs.tex
new file mode 100644
index 00000000000..158ad650139
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/qstest/makematch-qs.tex
@@ -0,0 +1,102 @@
+%%
+%% This is file `makematch-qs.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% makematch.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 makematch-qs.tex.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file makematch.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.)
+%%
+%% Copyright (C) 2006, 2007 QuinScape GmbH
+%% http://www.quinscape.de
+\RequirePackage{makematch,qstest}
+\IncludeTests{*}
+\begin{qstest}{\MakeMatcher}{\MakeMatcher}
+ \MakeMatcher\stylefiles{*.sty}
+ \MakeMatcher\headbang{!*}
+ \MakeMatcher[,]\truestylefiles{*.sty,!.thumbnails/*,!*/.thumbnails/*}
+ \begin{qstest}{\Makematcher literal}{\MakeMatcher}
+ \begin{ExpectCallSequence}{\true{}\false{}`%
+ .#1{\Expect*{\CalledName#1}{true}}+'}
+ \stylefiles{{xxx/.thumbnails/blubb.sty}}{\true}{\false}
+ \truestylefiles{{xxx/.thumbnails/blubb.sty}}{\false}{\true}
+ \headbang{{xxx/.thumbnails/blubb.sty}}{\false}{\true}
+ \stylefiles{[ ]{x.sty.gz .thumbnails/x.sty !x}}{\true}{\false}
+ \truestylefiles{[ ]{x.sty.gz .thumbnails/x.sty !x}}{\false}{\true}
+ \headbang{[ ]{x.sty.gz .thumbnails/x.sty !x}}{\true}{\false}
+ \end{ExpectCallSequence}
+ \end{qstest}
+ \begin{qstest}{\Makematcher with \MakeMatchTarget}%
+ {\MakeMatcher,\MakeMatchTarget}
+ \MakeMatchTarget\single{xxx/.thumbnails/blubb.sty}
+ \MakeMatchTarget[ ]\multiple{x.sty.gz .thumbnails/x.sty !x}
+ \begin{ExpectCallSequence}{\true{}\false{}`%
+ .#1{\Expect*{\CalledName#1}{true}}+'}
+ \stylefiles{\single}{\true}{\false}
+ \truestylefiles\single{\false}{\true}
+ \headbang\single{\false}{\true}
+ \stylefiles{\multiple}{\true}{\false}
+ \truestylefiles\multiple{\false}{\true}
+ \headbang\multiple{\true}{\false}
+ \end{ExpectCallSequence}
+ \end{qstest}
+ \begin{qstest}{\MatchedTarget}
+ {\MakeMatcher,\MakeMatchTarget,\MatchedTarget}
+ \MakeMatchTarget\single{xxx/.thumbnails/blubb.sty}
+ \MakeMatchTarget[ ]\multiple{x.sty.gz .thumbnails/x.sty !x}
+ \begin{ExpectCallSequence}{\true{}\false{}`%
+ .#1{\Expect*{\CalledName#1}{true}}+'}
+ \stylefiles{\single}{\true}{\false}
+ \Expect*{\single}{xxx/.thumbnails/blubb.sty}
+ \Expect*{\meaning\MatchedTarget}*{\meaning\single}
+ \RemoveMatched\single
+ \Expect*{\meaning\single}{macro:->}
+ \truestylefiles\single{\false}{\true}
+ \headbang\single{\false}{\true}
+ \stylefiles{\multiple}{\true}{\false}
+ \Expect*{\MatchedTarget}{.thumbnails/x.sty}
+ \RemoveMatched\multiple
+ \Expect\expandafter{\multiple}{x.sty.gz\,!x}
+ \truestylefiles\multiple{\false}{\true}
+ \Expect*{\meaning\MatchedTarget}{undefined}
+ \headbang\multiple{\true}{\false}
+ \Expect*{\MatchedTarget}{!x}
+ \RemoveMatched\multiple
+ \Expect*{\multiple}{x.sty.gz}
+ \end{ExpectCallSequence}
+ \end{qstest}
+\end{qstest}
+\makeatletter
+\begin{qstest}{\MakeMatcher internals}{\MakeMatcher,internal}
+ \MakeMatcher\sometest{}
+ \Expect*{\meaning\sometest}{macro:#1->\qst@setup#1\qst@finish}
+ \MakeMatcher[,]\sometest{ a, bc*, !woozle**, !*#*woz***.*x, !!*ab}
+ \Expect*{\meaning\sometest}{macro:#1->%
+ \qst@setup#1%
+ \qst@checkname{a}\@firstoftwo
+ \qst@checkname{bc##2}\@firstoftwo
+ \qst@checkname{woozle##2}\@secondoftwo
+ \qst@checkname{##2####3woz##4.##5x}\@secondoftwo
+ \qst@checkname{##2ab}\@firstoftwo
+ \qst@finish}
+ \MakeMatcher[ ]\another{ a bc* ! woozle** ! *#*woz***.*x ! ! *ab}
+ \Expect*{\meaning\another}*{\meaning\sometest}
+\end{qstest}
+\stop
+\endinput
+%%
+%% End of file `makematch-qs.tex'.
diff --git a/Master/texmf-dist/doc/latex/qstest/makematch.pdf b/Master/texmf-dist/doc/latex/qstest/makematch.pdf
new file mode 100644
index 00000000000..6ea44fda1ae
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/qstest/makematch.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/qstest/qstest-qs.tex b/Master/texmf-dist/doc/latex/qstest/qstest-qs.tex
new file mode 100644
index 00000000000..6572afd0a5b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/qstest/qstest-qs.tex
@@ -0,0 +1,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'.
diff --git a/Master/texmf-dist/doc/latex/qstest/qstest.pdf b/Master/texmf-dist/doc/latex/qstest/qstest.pdf
new file mode 100644
index 00000000000..29fa678ef81
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/qstest/qstest.pdf
Binary files differ