diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/cweb/src/test |
Initial commit
Diffstat (limited to 'macros/latex/contrib/cweb/src/test')
25 files changed, 750 insertions, 0 deletions
diff --git a/macros/latex/contrib/cweb/src/test/Imakefile b/macros/latex/contrib/cweb/src/test/Imakefile new file mode 100644 index 0000000000..0d32d8301c --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/Imakefile @@ -0,0 +1,142 @@ +XCOMM $Id: Imakefile,v 1.9 1995/11/20 22:34:44 schrod Exp $ +/* ---------------------------------------------------------------------- */ + +/* + * Imakefile for test of cweb bundle + * + * (history at end) + */ + + +/* needed modules */ +#define idx NO_IDX_CLEAN /* don't delete *.idx on make clean */ +#include <TeX.imk> +#undef idx + +XCOMM ------------------------------------------------------------ +XCOMM continue in Imakefile + +.SUFFIXES: .tex .w + +.w.tex: @@\ + if [ -r $*.ch ] ; \ @@\ + then cweave $* $* ; \ @@\ + else cweave $* ; \ @@\ + fi + + +regression:: clean + $(MAKE) all + + +/* ============================================================ + * + * tests for cweb class & cwebarray package + */ + +TeXTarget(latex,minimal) /* minimal document */ +TeXTarget(latex,token) /* rendering of tokens */ +TeXTarget(latex,refname) /* refinement names, filename ref. */ +TeXTarget(latex,modes) /* cweb FSA */ +TeXTarget(latex,section) /* hierarchic document structure */ +TeXTarget(latex,flat) /* flat document structure */ +TeXTarget(latex,report) /* report as base class */ +TeXTarget(latex,nolists) /* nolists via CWEAVE option -x */ +TeXTarget(latex,newif) /* idiosyncrasy of old LateX version */ + +TeXTarget(latex,enddocbegin) /* skip stuff after \end{document} */ +TeXTarget(latex,vbar) /* ruled table [cwebarray] */ +TeXTarget(latex,titlepage) /* titlepage option */ + +TeXTarget(latex,language-german) /* language option german */ +TeXTarget(latex,german) /* babel-compatible option german */ + +TeXTarget(latex,change) /* changefile-related output */ +TeXTarget(latex,sup-changes) /* changefile-related suppression */ + +TeXTarget(latex,sup-lists) /* suppression of index & reflist */ +TeXTarget(latex,sup-format) /* suppression of format directives */ + +TeXTarget(latex '\nonstopmode \input',badend) /* unknown \end expansion */ +TeXTarget(latex '\nonstopmode \input',badopts) /* unknown & illegal options */ + + +/* + * Special (additional) rules for targets above + */ + +nolists.tex: nolists.w + cweave -x nolists + +change.tex: change.ch + +sup-changes.tex: sup-changes.w change.ch + cweave sup-changes change + + + +/* ============================================================ + * + * tests for packages + */ + +/* cwebparts */ + +TeXTarget(latex,parts) /* CWEB parts in LaTeX document */ + +parts.dvi: parts-code.tex + +parts-code.tex: parts-code.w + cweave -x parts-code + + + +/* ============================================================ + * + * Tests for stuff that is not strictly part of the cweb bundle. + */ + +TeXTarget(latex,keyvald) /* keyword-value options w/ defaults */ + + +realclean:: clean + rm -f *.idx *.scn *.tex + + + +/* ============================================================ + * + * $Log: Imakefile,v $ + * Revision 1.9 1995/11/20 22:34:44 schrod + * Test language support, actually for German. + * + * Revision 1.8 1995/11/07 18:28:52 schrod + * Add test newif, for old LaTeX version. + * + * Revision 1.7 1995/09/17 14:21:36 schrod + * Test package cwbl-german. + * + * Revision 1.6 1995/09/16 17:02:09 schrod + * Test cwebparts.sty. + * + * Revision 1.5 1995/09/12 22:32:21 schrod + * Add test case for output of CWEAVE with `-x' option. + * + * Revision 1.4 1995/08/29 15:22:14 schrod + * Add test of format directive suppression. + * + * Revision 1.3 1995/08/27 13:29:38 schrod + * Tests of options & changefile-related suppression. + * + * Revision 1.2 1995/08/25 19:12:39 schrod + * Test implementation of hierarchic and flat structure. + * + * Revision 1.1 1995/08/08 00:14:46 schrod + * Updated to \LaTeXe{}, the |cweb| style is now a document class. + * + + * ------------------------------------------------------------ + * Local Variables: + * mode: Indented-Text + * End: + */ diff --git a/macros/latex/contrib/cweb/src/test/badend.w b/macros/latex/contrib/cweb/src/test/badend.w new file mode 100644 index 0000000000..51060a65cf --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/badend.w @@ -0,0 +1,21 @@ +% $Id: badend.w,v 1.3 1995/08/08 00:14:46 schrod Exp $ +%---------------------------------------------------------------------- + +% tests unknown \end macro +% assumes "h" and "x" user reaction +% note: produces no output! + +\makeatletter +\def\end#1{\csname end#1\endcsname\@@checkend{#1}% + \expandafter\endgroup \if@@endpe \@@doendpe \fi +\relax % <-- added + \if@@ignore \global\@@ignorefalse \ignorespaces\fi} +\makeatother + +\documentclass{cweb} + +\begin{document} + +@ Test + +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/badopts.w b/macros/latex/contrib/cweb/src/test/badopts.w new file mode 100644 index 0000000000..5fff5f7add --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/badopts.w @@ -0,0 +1,13 @@ +% $Id: badopts.w,v 1.1 1995/08/27 13:29:39 schrod Exp $ +%------------------------------------------------------------ + +% test bad options + +\documentclass[undef,structure,structure=chaos]{cweb} + +\begin{document} + +Text. + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/change.ch b/macros/latex/contrib/cweb/src/test/change.ch new file mode 100644 index 0000000000..2796a280e6 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/change.ch @@ -0,0 +1,5 @@ +@x +change here +@y +did the change +@z diff --git a/macros/latex/contrib/cweb/src/test/change.w b/macros/latex/contrib/cweb/src/test/change.w new file mode 100644 index 0000000000..d787065b93 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/change.w @@ -0,0 +1,20 @@ +% $Id: change.w,v 1.4 1995/08/27 13:29:40 schrod Exp $ +%---------------------------------------------------------------------- + +% tests changefile output + +\documentclass{cweb} + +\begin{document} + +\title{Test for changefiles} +\author{Coogar} +\maketitle + +@ test + +@ +change here + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/enddocbegin.w b/macros/latex/contrib/cweb/src/test/enddocbegin.w new file mode 100644 index 0000000000..64d77368e1 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/enddocbegin.w @@ -0,0 +1,16 @@ +% $Id: enddocbegin.w,v 1.3 1995/08/08 00:14:47 schrod Exp $ +%---------------------------------------------------------------------- + +% tests skip of stuff after \end{document} + +\documentclass{cweb} + +\begin{document} + +@ Test. + +\end{document} + +\begin{itemize} +\item an item +\end{itemize} diff --git a/macros/latex/contrib/cweb/src/test/flat.w b/macros/latex/contrib/cweb/src/test/flat.w new file mode 100644 index 0000000000..993193971f --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/flat.w @@ -0,0 +1,47 @@ +% $Id: flat.w,v 1.1 1995/08/25 19:12:40 schrod Exp $ +%---------------------------------------------------------------------- + +% tests section levels and references for flat structure documents. + +\documentclass[structure=flat]{cweb} + +\begin{document} + +\tableofcontents + +\newpage + +@** s title. +\label{main-sec} + +Some text. + +@* e title. + +Some text. +And some references: Part~\ref{main-sec} and section~\ref{normal-sec}. + +@*0 0 title. + +Some text. + +@*1 1 title. + +Some text. + +@*2 2 title. + +Some text. + +@ \label{normal-sec} +Doc. + +@d def foo +@f def int + +@c +for ( int i=1; i<10; i++ ) + @< do something @> + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/german.w b/macros/latex/contrib/cweb/src/test/german.w new file mode 100644 index 0000000000..dd6f5d64bb --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/german.w @@ -0,0 +1,33 @@ +% $Id: german.w,v 1.3 1995/11/20 22:34:44 schrod Exp $ +%---------------------------------------------------------------------- + +% tests german language support + + +% check if option after german works as well +\documentclass[german,suppress=index]{cweb} + +\usepackage{german} + +\begin{document} + +\title{Test der \texttt{german} Option} +\author{Puma} +\maketitle + +@ Aktives Anf\"uhrungszeichen im String. +@c +#include "foo.h" + +@ @( foo.h@>= +@< etwas |code| @>@; +@< mehr Code @> + +@ @< etwas ...@>= +for ( int i=1; i<10; i++ ) + @< mehr... @> + +@ @< mehr... @>= + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/language-german.ch b/macros/latex/contrib/cweb/src/test/language-german.ch new file mode 100644 index 0000000000..1e41e64e1e --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/language-german.ch @@ -0,0 +1,5 @@ +@x +@< mehr Code @> +@y +@< mehr -- ge\"anderter -- Code @> +@z diff --git a/macros/latex/contrib/cweb/src/test/language-german.w b/macros/latex/contrib/cweb/src/test/language-german.w new file mode 100644 index 0000000000..bd145c4f92 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/language-german.w @@ -0,0 +1,31 @@ +% $Id: language-german.w,v 1.1 1995/11/20 22:34:45 schrod Exp $ +%---------------------------------------------------------------------- + +% tests german language support + +\documentclass[language=german]{cweb} + +\usepackage{german} + +\begin{document} + +\title{Test der \texttt{language} Option} +\author{Puma} +\maketitle + +@ Aktives Anf\"uhrungszeichen im String. +@c +#include "foo.h" + +@ @( foo.h@>= +@< etwas |code| @>@; +@< mehr Code @> + +@ @< etwas ...@>= +for ( int i=1; i<10; i++ ) + @< mehr... @> + +@ @< mehr... @>= + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/minimal.w b/macros/latex/contrib/cweb/src/test/minimal.w new file mode 100644 index 0000000000..fc0cdaa492 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/minimal.w @@ -0,0 +1,12 @@ +% $Id: minimal.w,v 1.4 1995/08/25 19:12:41 schrod Exp $ +%---------------------------------------------------------------------- + +% tests minimal CWEB w/ LaTeX input file + +\documentclass{cweb} +\begin{document} + +Test. + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/modes.w b/macros/latex/contrib/cweb/src/test/modes.w new file mode 100644 index 0000000000..48525ae38d --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/modes.w @@ -0,0 +1,16 @@ +% $Id: modes.w,v 1.3 1995/08/27 19:28:49 schrod Exp $ +%---------------------------------------------------------------------- + +\documentclass{cweb} + +\begin{document} + +@ program $\to$ program with documentation of |bar(i+1)|. + +@d foo bar +@< refinement @>= + stmt; + + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/newif.w b/macros/latex/contrib/cweb/src/test/newif.w new file mode 100644 index 0000000000..53ae277514 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/newif.w @@ -0,0 +1,39 @@ +% $Id: newif.w,v 1.1 1995/11/07 18:28:52 schrod Exp $ +%------------------------------------------------------------ + +% test that proper definition of \newif is established. + + +% First, restore problematic definition and pretend we're an old LaTeX. + +\makeatletter + +\outer\def\newif#1{\count@@\escapechar \escapechar\m@@ne + \expandafter\expandafter\expandafter + \edef\@@if#1{true}{\let\noexpand#1=\noexpand\iftrue}% + \expandafter\expandafter\expandafter + \edef\@@if#1{false}{\let\noexpand#1=\noexpand\iffalse}% + \@@if#1{false}\escapechar\count@@} % the condition starts out false + +\let\OldNewif=\newif + +\edef\fmtversion{1994/12/01} + +\makeatother + + +% Now, start the document and check if \newif got redefined. + +\documentclass{cweb} + +\begin{document} + +\ifx \OldNewif\newif + \errmessage{\string\newif\space was not redefined.} +\else + \message{\string\newif\space got redefined.} +\fi + +@ Test. + +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/nolists.w b/macros/latex/contrib/cweb/src/test/nolists.w new file mode 100644 index 0000000000..190c22c3c2 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/nolists.w @@ -0,0 +1,16 @@ +% $Id: nolists.w,v 1.1 1995/09/12 22:32:22 schrod Exp $ +%------------------------------------------------------------ + +% test suppression of index & ref list + +\documentclass{cweb} + +\begin{document} + +@ We need something to add to the lists. + +@< refinement @>= +foo(bar); + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/parts-code.w b/macros/latex/contrib/cweb/src/test/parts-code.w new file mode 100644 index 0000000000..ad24b1e2b2 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/parts-code.w @@ -0,0 +1,32 @@ +% $Id: parts-code.w,v 1.1 1995/09/16 17:02:10 schrod Exp $ +%------------------------------------------------------------ + +% test of `cwebparts' package: +% code parts to be included in a LaTeX document +% no sections + +\documentclass{cweb} + +\usepackage{rcs} + +\begin{document} + +\title{Believe it} +\author{Coogar} + +\maketitle + +@ Some explanation of the code below. It's very hairy, isn't it? + +@( foo.h@>= +@< some |code| @>@; +@< more code @> + +@ @< some ...@>= +for ( int i=1; i<10; i++ ) + @< more... @> + +@ @< more... @>= + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/parts.tex b/macros/latex/contrib/cweb/src/test/parts.tex new file mode 100644 index 0000000000..252b212991 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/parts.tex @@ -0,0 +1,47 @@ +% $Id: parts.tex,v 1.1 1995/09/16 17:02:10 schrod Exp $ +%---------------------------------------------------------------------- + +% +% test of inclusion of CWEB program parts +% +% [LaTeX] +% (history at end) + + + +\documentclass{article} + +\usepackage{cwebparts} + + +\begin{document} + + + +\title{Foobar Algorithm} +\author{Cougar} + +\maketitle + +\makeatletter + + +\section{C Implementation} + +Let's have a look at the implementation in C: + +\cwebInput{parts-code} + +\noindent Got it? + + + +\end{document} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +$Log: parts.tex,v $ +Revision 1.1 1995/09/16 17:02:10 schrod + Test cwebparts.sty. + diff --git a/macros/latex/contrib/cweb/src/test/refname.w b/macros/latex/contrib/cweb/src/test/refname.w new file mode 100644 index 0000000000..e15fa990dd --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/refname.w @@ -0,0 +1,21 @@ +% $Id: refname.w,v 1.3 1995/08/08 00:14:49 schrod Exp $ +%---------------------------------------------------------------------- + +% tests refinement names, incl. pseudo-refinements w/ file names + +\documentclass{cweb} + +\begin{document} + +@ @( foo.h@>= +@< some |code| @>@; +@< more code @> + +@ @< some ...@>= +for ( int i=1; i<10; i++ ) + @< more... @> + +@ @< more... @>= + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/report.w b/macros/latex/contrib/cweb/src/test/report.w new file mode 100644 index 0000000000..15242e7908 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/report.w @@ -0,0 +1,48 @@ +% $Id: report.w,v 1.1 1995/08/27 17:25:40 schrod Exp $ +%------------------------------------------------------------ + +% test baseclass option +% default is `report' + +\documentclass[baseclass]{cweb} + +\begin{document} + +\tableofcontents + +\newpage + +@** s title. +\label{main-sec} + +Some text. + +@* e title. + +Some text. +And some references: Part~\ref{main-sec} and section~\ref{normal-sec}. + +@*0 0 title. + +Some text. + +@*1 1 title. + +Some text. + +@*2 2 title. + +Some text. + +@ \label{normal-sec} +Doc. + +@d def foo +@f def int + +@c +for ( int i=1; i<10; i++ ) + @< do something @> + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/section.w b/macros/latex/contrib/cweb/src/test/section.w new file mode 100644 index 0000000000..13159e2fc6 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/section.w @@ -0,0 +1,55 @@ +% $Id: section.w,v 1.6 1995/11/07 14:14:25 schrod Exp $ +%---------------------------------------------------------------------- + +% tests section levels and references. + +\documentclass{cweb} + +\begin{document} + +\tableofcontents + +\newpage + +@** s title. +\label{main-sec} + +Some text. + +@* e title. + +Some text. +And some references: Part~\ref{main-sec} and section~\ref{normal-sec}. + +@*0 0 title. + +Some text. + +@*1 1 title. + +Some text. + +@*2 2 title. + +Some text. + +@*1 1 title. + +Reset counter. + +@*2 2 title. + +Some text. + +@ \label{normal-sec} +Doc. + +@d def foo +@f def int + +@c +for ( int i=1; i<10; i++ ) + @< do something @> + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/sup-changes.w b/macros/latex/contrib/cweb/src/test/sup-changes.w new file mode 100644 index 0000000000..019dc8388e --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/sup-changes.w @@ -0,0 +1,20 @@ +% $Id: sup-changes.w,v 1.1 1995/08/27 13:29:40 schrod Exp $ +%---------------------------------------------------------------------- + +% tests suppress=unchanged + +\documentclass[suppress=unchanged]{cweb} + +\begin{document} + +\title{Test for suppression of unchanged chunks} +\author{Coogar} +\maketitle + +@ test + +@ +change here + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/sup-format.w b/macros/latex/contrib/cweb/src/test/sup-format.w new file mode 100644 index 0000000000..eec493ff4f --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/sup-format.w @@ -0,0 +1,17 @@ +% $Id: sup-format.w,v 1.1 1995/08/29 15:22:17 schrod Exp $ +%------------------------------------------------------------ + +% test suppression of format directives + +\documentclass[suppress=format]{cweb} + +\begin{document} + +@ test +@f XmMainWindow int +@f foo int +@f bar i +XmMainWindow dir = XtCreateWidget("foobar"); + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/sup-lists.w b/macros/latex/contrib/cweb/src/test/sup-lists.w new file mode 100644 index 0000000000..2049f36151 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/sup-lists.w @@ -0,0 +1,16 @@ +% $Id: sup-lists.w,v 1.1 1995/08/27 19:29:07 schrod Exp $ +%------------------------------------------------------------ + +% test suppression of index & ref list + +\documentclass[suppress={index,reflist}]{cweb} + +\begin{document} + +@ We need something to add to the lists. + +@< refinement @>= +foo(bar); + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/titlepage.w b/macros/latex/contrib/cweb/src/test/titlepage.w new file mode 100644 index 0000000000..b8230cebeb --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/titlepage.w @@ -0,0 +1,19 @@ +% $Id: titlepage.w,v 1.1 1995/08/27 13:29:41 schrod Exp $ +%------------------------------------------------------------ + +% test titlepage option +% test also forwarding of option to baseclass + +\documentclass[titlepage]{cweb} + +\begin{document} + +\title{Test title} +\author{Coogar} + +\maketitle + +Test text. + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/token.w b/macros/latex/contrib/cweb/src/test/token.w new file mode 100644 index 0000000000..7765f1b9b3 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/token.w @@ -0,0 +1,29 @@ +% $Id: token.w,v 1.3 1995/08/29 15:21:08 schrod Exp $ +%---------------------------------------------------------------------- + +% tests: rendering of tokens + +\documentclass{cweb} + +\begin{document} + +@ +@c +a = 100L; +a = 100UL; + +@ shift operators: +@c +cout << "hello, world" << endl; +cin >> var; + +@ formatting that depend on font sizes in Plain \texttt{CWEB}: +@f foo_bar int +@c +foo++; bar--; +foo_bar obj; +obj->method(); + + +@ +\end{document} diff --git a/macros/latex/contrib/cweb/src/test/vbar.w b/macros/latex/contrib/cweb/src/test/vbar.w new file mode 100644 index 0000000000..144b2810b3 --- /dev/null +++ b/macros/latex/contrib/cweb/src/test/vbar.w @@ -0,0 +1,30 @@ +% $Id: vbar.w,v 1.2 1995/08/08 00:14:51 schrod Exp $ +%---------------------------------------------------------------------- + +% tests ways to get ruled tables + +\documentclass{cweb} + +\usepackage{cwebarray} + +\begin{document} + +@ Test 1: + +\begin{tabular}{^^7cl^^7cl^^7c} +\hline +1st column & 2nd column\\ +\hline +\end{tabular} + + +@ Test 2: + +\begin{tabular}{IlIlI} +\hline +1st column & 2nd column\\ +\hline +\end{tabular} + + +\end{document} |