Initial import of nuweb-1.62

This is just the following tarball expanded:

https://sourceforge.net/projects/nuweb/files/nuweb-1.62.tar.gz/download
This commit is contained in:
2024-03-15 08:04:56 +00:00
commit 6ba17b6389
58 changed files with 32042 additions and 0 deletions

113
test/00/t0001a.sh Normal file
View File

@@ -0,0 +1,113 @@
#!/bin/sh
#
# $RCSfile: t0001a.sh,v $ -- Test test/00/t0001a.sh
#
#
# Test of formating bare parameter uses
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of formating bare parameter uses" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of formating bare parameter uses" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test formating bare parameter uses
#
cat > test.w <<"EOF"
@d Test with parameter
@{Try @1 parameter.
@}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Test with parameter}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Try @{\tt @}\verb@1 parameter.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item {\NWtxtMacroNoRef}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

119
test/00/t0002a.sh Normal file
View File

@@ -0,0 +1,119 @@
#!/bin/sh
#
# $RCSfile: t0002a.sh,v $-- Test test/00/t0002a.sh
#
#
# Test of formatting parameters in index
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of formatting parameters in index" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of formatting parameters in index" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test formatting parameters in index
#
cat > test.w <<"EOF"
@d Test @'param@' in index
@{Param @1 here
@}
@m
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Test \hbox{\slshape\sffamily param\/} in index}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Param @\hbox{\slshape\sffamily param\/}\verb@ here@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item {\NWtxtMacroNoRef}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Test \hbox{\slshape\sffamily param\/} in index\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtNoRef}.}
\end{list}}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

122
test/00/t0003a.sh Normal file
View File

@@ -0,0 +1,122 @@
#!/bin/sh
#
# $RCSfile: t0003a.sh,v $-- Test test/00/t0003a.sh
#
#
# Test of more vspace in file entry
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of more vspace in file entry" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of more vspace in file entry" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test more vspace in file entry
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c
@{File defining fred and jim.
See?
@| fred jim @}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@File defining fred and jim.@\\
\mbox{}\verb@@\\
\mbox{}\verb@See? @\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtIdentsDefed\nobreak\ \verb@fred@\nobreak\ \NWtxtIdentsNotUsed, \verb@jim@\nobreak\ \NWtxtIdentsNotUsed.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

179
test/00/t0004a.sh Normal file
View File

@@ -0,0 +1,179 @@
#!/bin/sh
#
# $RCSfile: t0004a.sh,v $-- Test test/00/t0004a.sh
#
#
# Test of indent before parameter
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of indent before parameter" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of indent before parameter" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test indent before parameter
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c
@{Start
@<Here is the first call@>
End
@}
@d Here is the first call
@{@<Use @'xxx@' as parameter@>
@<Use @'ZZZ@' as parameter@>
@}
@d Use @'yyy@' as...
@{@1 is here.
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Start@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Here is the first call}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@End@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Here is the first call}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\hbox{$\langle\,${\itshape Use \verb@xxx@ as parameter}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Use \verb@ZZZ@ as parameter}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Use \hbox{\slshape\sffamily yyy\/} as parameter}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\hbox{\slshape\sffamily yyy\/}\verb@ is here.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Start
xxx is here.
ZZZ is here.
End
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

224
test/00/t0005a.sh Normal file
View File

@@ -0,0 +1,224 @@
#!/bin/sh
#
# $RCSfile: t0005a.sh,v $-- Test test/00/t0005a.sh
#
#
# Test of Commenting macroes as argument uses
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Commenting macroes as argument uses" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Commenting macroes as argument uses" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Commenting macroes as argument uses
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c -cc
@{Call the macro
@<Fragment with @<A macro argument@> as parameter@>
@<Second frag with @<A macro argument@> as parameter@>
@<Third frag with @<A macro argument@> as parameter@>
@}
@d Fragment with @'Begin macro@'...
@{@1<<<Here 'tis.
That argument was at the beginning of the fragment@}
@d Second frag with @'Begin line@'...
@{Here is the beginning of the second macro
@1<<<That is the argument
And this is the end of the second frag@}
@d Third frag with @'Embedded@'...
@{Here is the argument>>>@1<<<That was it.@}
@d A macro argument
@{Hello folks@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Call the macro@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Fragment with $\langle\,${\itshape A macro argument}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ as parameter}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Second frag with $\langle\,${\itshape A macro argument}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ as parameter}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Third frag with $\langle\,${\itshape A macro argument}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ as parameter}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Fragment with \hbox{\slshape\sffamily Begin macro\/} as parameter}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\hbox{\slshape\sffamily Begin macro\/}\verb@<<<Here 'tis.@\\
\mbox{}\verb@That argument was at the beginning of the fragment@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Second frag with \hbox{\slshape\sffamily Begin line\/} as parameter}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is the beginning of the second macro@\\
\mbox{}\verb@@\hbox{\slshape\sffamily Begin line\/}\verb@<<<That is the argument@\\
\mbox{}\verb@And this is the end of the second frag@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Third frag with \hbox{\slshape\sffamily Embedded\/} as parameter}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is the argument>>>@\hbox{\slshape\sffamily Embedded\/}\verb@<<<That was it.@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap5}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape A macro argument}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Hello folks@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Call the macro
/* Fragment with <A macro argument> as parameter */
/* A macro argument */
Hello folks<<<Here 'tis.
That argument was at the beginning of the fragment
/* Second frag with <A macro argument> as parameter */
Here is the beginning of the second macro
/* A macro argument */
Hello folks<<<That is the argument
And this is the end of the second frag
/* Third frag with <A macro argument> as parameter */
Here is the argument>>>Hello folks<<<That was it.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

119
test/00/t0006a.sh Normal file
View File

@@ -0,0 +1,119 @@
#!/bin/sh
#
# $RCSfile: t0006a.sh,v $-- Test test/00/t0006a.sh
#
#
# Test of cross-reference flag
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of cross-reference flag" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of cross-reference flag" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test cross-reference flag
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c -cc
@{Call the macro
@<Fragment with @<A macro argument@> as parameter@>
@<Second frag with @<A macro argument@> as parameter@>
@<Third frag with @<A macro argument@> as parameter@>
@}
@d Fragment with @'Begin macro@'...
@{@1<<<Here 'tis.
That argument was at the beginning of the fragment@}
@d Second frag with @'Begin line@'...
@{Here is the beginning of the second macro
@1<<<That is the argument
And this is the end of the second frag@}
@d Third frag with @'Embedded@'...
@{Here is the argument>>>@1<<<That was it.@}
@d A macro argument
@{Hello folks@}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Call the macro
/* Fragment with <A macro argument> as parameter 1b */
/* A macro argument 1e */
Hello folks<<<Here 'tis.
That argument was at the beginning of the fragment
/* Second frag with <A macro argument> as parameter 1c */
Here is the beginning of the second macro
/* A macro argument 1e */
Hello folks<<<That is the argument
And this is the end of the second frag
/* Third frag with <A macro argument> as parameter 1d */
Here is the argument>>>Hello folks<<<That was it.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb -x test.w
if test $? -ne 0 ; then fail; fi
latex test
$bin/nuweb -x test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

192
test/00/t0007a.sh Normal file
View File

@@ -0,0 +1,192 @@
#!/bin/sh
#
# $RCSfile: t0007a.sh,v $-- Test test/00/t0007a.sh
#
#
# Test of ???
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of ???" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of ???" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Here is a macro that defines something.
@d Define something
@{something anything
@| something anything @}
Here is a macro that uses an argument
@d Use the @'thing@'
@{Use @1
Use anything
@}
Now use the something in an argument
@o test.c -cc
@{
@<Define something@>
@<Use the @'something@'@>
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here is a macro that defines something.
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} $\langle\,${\itshape Define something}\nobreak\ {\footnotesize {1a}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@something anything@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1c}{1c}.
\item \NWtxtIdentsDefed\nobreak\ \verb@anything@\nobreak\ \NWlink{nuweb1b}{1b}, \verb@something@\nobreak\ \NWlink{nuweb1c}{1c}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
Here is a macro that uses an argument
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Use the \hbox{\slshape\sffamily thing\/}}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use @\hbox{\slshape\sffamily thing\/}\verb@@\\
\mbox{}\verb@Use anything@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1c}{1c}.
\item \NWtxtIdentsUsed\nobreak\ \verb@anything@\nobreak\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
Now use the something in an argument
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb1c}{} \verb@"test.c"@\nobreak\ {\footnotesize {1c}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Define something}\nobreak\ {\footnotesize \NWlink{nuweb1a}{1a}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Use the \verb@something@}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtIdentsUsed\nobreak\ \verb@something@\nobreak\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
/* Define something */
something anything
/* Use the 'something' */
Use something
Use anything
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

179
test/00/t0008a.sh Normal file
View File

@@ -0,0 +1,179 @@
#!/bin/sh
#
# $RCSfile: t0008a.sh,v $-- Test test/00/t0008a.sh
#
#
# Test of Version flag
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Version flag" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Version flag" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Version flag
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Here >>@v<< is the version information.
@o test.c -cc
@{Here >>@v<< is the version information in code.
@}
\end{document}
EOF
cat > test.expected.with.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here >>3.14159<< is the version information.
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here >>3.14159<< is the version information in code.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.with.c <<"EOF"
Here >>3.14159<< is the version information in code.
EOF
cat > test.expected.without.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here >>no version<< is the version information.
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here >>no version<< is the version information in code.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.without.c <<"EOF"
Here >>no version<< is the version information in code.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb -V 3.14159 test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.with.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.with.c test.c
if test $? -ne 0 ; then fail; fi
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.without.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.without.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

145
test/00/t0009a.sh Normal file
View File

@@ -0,0 +1,145 @@
#!/bin/sh
#
# $RCSfile: t0009a.sh,v $-- Test test/00/t0009a.sh
#
#
# Test of user specified use of identifiers
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of user specified use of identifiers" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of user specified use of identifiers" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test user specified use of identifiers
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Define a thing.
@o test.c -cc
@{This defines ident.
@<Use the thing defined@>
@| ident @}
Now use it without it actually appearing in the text.
@d Use the thing defined
@{Pretend that we use it here.
@* ident @}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Define a thing.
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This defines ident.@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Use the thing defined}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtIdentsDefed\nobreak\ \verb@ident@\nobreak\ \NWlink{nuweb1b}{1b}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
Now use it without it actually appearing in the text.
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Use the thing defined}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Pretend that we use it here.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item \NWtxtIdentsUsed\nobreak\ \verb@ident@\nobreak\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
latex test
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

135
test/00/t0010a.sh Normal file
View File

@@ -0,0 +1,135 @@
#!/bin/sh
#
# $RCSfile: t0010a.sh,v $-- Test test/00/t0010a.sh
#
#
# Test cross-reference isn't followed by 'x'
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test cross-reference isn't followed by 'x'" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test cross-reference isn't followed by 'x'" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Here is a cross-reference: @xref@x
@o test.c
@{This (@xref@x) is where it is referencing.
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here is a cross-reference: 1-01
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1}{} \verb@"test.c"@\nobreak\ {\footnotesize {1}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This (1-01) is where it is referencing.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
This (1-01) is where it is referencing.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
if test $? -ne 0 ; then fail; fi
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

97
test/00/t0011a.sh Normal file
View File

@@ -0,0 +1,97 @@
#!/bin/sh
#
# $RCSfile: t0011a.sh,v $-- Test test/00/t0011a.sh
#
#
# Test that unimpemented fragments are indented
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test that unimpemented fragments are indented" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test that unimpemented fragments are indented" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c
@{Begin
@<Implemented fragment@>
End
@}
@d Impl...
@{@<Unimplemented fragment A@>
@<Unimplemented fragment B@>
@<Unimplemented fragment C@>@}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Begin
@<Unimplemented fragment A@>
@<Unimplemented fragment B@>
@<Unimplemented fragment C@>
End
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

204
test/00/t0012a.sh Normal file
View File

@@ -0,0 +1,204 @@
#!/bin/sh
#
# $RCSfile: t0012a.sh,v $-- Test test/00/t0012a.sh
#
#
# Test of block comments
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of block comments" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of block comments" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test block comments
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@c Here is a block comment which is long enough to need line
breaking. (And a bit extra.)
Here is a block comment which is long enough to need line
breaking.
Here is a block comment which is long enough to need line
breaking. (Some more extra.)
Here is a block comment which is long enough to need line
breaking.
Here is more of the block comment. It is also long enough to
need line-breaking.
@o test.c -cc
@{Here is some stuff.
@c
Here is the end of the stuff.
Here (@c) is a block comment in code.
@}
@c This is another block comment that shouldn't end in a
newline. (So long as its length is right.
@o test.c -cc
@{This --@c-- is where it is used.
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth} Here is a block comment which is long enough to need line
breaking. (And a bit extra.)
Here is a block comment which is long enough to need line
breaking.
Here is a block comment which is long enough to need line
breaking. (Some more extra.)
Here is a block comment which is long enough to need line
breaking.
Here is more of the block comment. It is also long enough to
need line-breaking.
\par\vspace{\baselineskip}
\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is some stuff.@\\
\mbox{}\verb@ @\hbox{\sffamily\slshape (Comment)}\verb@@\\
\mbox{}\verb@Here is the end of the stuff.@\\
\mbox{}\verb@Here (@\hbox{\sffamily\slshape (Comment)}\verb@) is a block comment in code.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb?}{?}\NWlink{nuweb?}{, ?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth} This is another block comment that shouldn't end in a
newline. (So long as its length is right.
\par\vspace{\baselineskip}
\label{scrap2}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This --@\hbox{\sffamily\slshape (Comment)}\verb@-- is where it is used.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb?}{?}\NWlink{nuweb?}{, ?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Here is some stuff.
/* Here is a block comment which is long enough to need line
* breaking. (And a bit extra.) Here is a block comment which
* is long enough to need line breaking. Here is a block comment
* which is long enough to need line breaking. (Some more extra.)
* Here is a block comment which is long enough to need line
* breaking.
* Here is more of the block comment. It is also long enough
* to need line-breaking.
*/
Here is the end of the stuff.
Here (/* Here is a block comment which is long enough to need
* line breaking. (And a bit extra.) Here is a block comment
* which is long enough to need line breaking. Here is a
* block comment which is long enough to need line breaking.
* (Some more extra.) Here is a block comment which is long
* enough to need line breaking.
* Here is more of the block comment. It is also long enough
* to need line-breaking.
*/) is a block comment in code.
This --/* This is another block comment that shouldn't end in
* a newline. (So long as its length is right. */-- is where it is used.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

158
test/00/t0013a.sh Normal file
View File

@@ -0,0 +1,158 @@
#!/bin/sh
#
# $RCSfile: t0013a.sh,v $-- Test test/00/t0013a.sh
#
#
# Test block comments aren't indexed
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test block comments aren't indexed" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test block comments aren't indexed" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@c
Here is a block comment which contains the word 'target'.
@o test.c -cc
@{Here is a fragment which contains the block comment
@c
That was the block comment.
Here we use another fragment.
@<Define...@>
@}
@d Define our target
@{This fragment defines 'target'.
@| target @}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}
Here is a block comment which contains the word 'target'.
\par\vspace{\baselineskip}
\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is a fragment which contains the block comment@\\
\mbox{}\verb@@\hbox{\sffamily\slshape (Comment)}\verb@@\\
\mbox{}\verb@That was the block comment.@\\
\mbox{}\verb@Here we use another fragment.@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Define our target}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Define our target}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This fragment defines 'target'.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item \NWtxtIdentsDefed\nobreak\ \verb@target@\nobreak\ \NWtxtIdentsNotUsed.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

125
test/00/t0014a.sh Normal file
View File

@@ -0,0 +1,125 @@
#!/bin/sh
#
# $RCSfile: t0014a.sh,v $-- Test test/00/t0014a.sh
#
#
# Test of @@ in scraps
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of @@ in scraps" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of @@ in scraps" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test @@ in scraps
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c -cc
@{This scrap contains @@<.
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This scrap contains @{\tt @}\verb@<.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
This scrap contains @<.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

152
test/00/t0015a.sh Normal file
View File

@@ -0,0 +1,152 @@
#!/bin/sh
#
# $RCSfile: t0015a.sh,v $-- Test test/00/t0015a.sh
#
#
# Test of ???
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of ???" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of ???" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@d Sort @'key@' of size @'n@' for @'ordering@'
@{for (int j = 1; j < @2; j++)
{
int i = j - 1;
int kj = @1[j];
do
{
int ki = @1[i];
if (@3)
break;
@1[i + 1] = ki;
i -= 1;
} while (i >= 0);
@1[i + 1] = kj;
}
@}
Test in-text @{@<Sort @'key@'...@>@} usage.
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Sort \hbox{\slshape\sffamily key\/} of size \hbox{\slshape\sffamily n\/} for \hbox{\slshape\sffamily ordering\/}}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@for (int j = 1; j < @\hbox{\slshape\sffamily n\/}\verb@; j++)@\\
\mbox{}\verb@{@\\
\mbox{}\verb@ int i = j - 1;@\\
\mbox{}\verb@ int kj = @\hbox{\slshape\sffamily key\/}\verb@[j];@\\
\mbox{}\verb@@\\
\mbox{}\verb@ do@\\
\mbox{}\verb@ {@\\
\mbox{}\verb@ int ki = @\hbox{\slshape\sffamily key\/}\verb@[i];@\\
\mbox{}\verb@@\\
\mbox{}\verb@ if (@\hbox{\slshape\sffamily ordering\/}\verb@)@\\
\mbox{}\verb@ break;@\\
\mbox{}\verb@ @\hbox{\slshape\sffamily key\/}\verb@[i + 1] = ki;@\\
\mbox{}\verb@ i -= 1;@\\
\mbox{}\verb@ } while (i >= 0);@\\
\mbox{}\verb@ @\hbox{\slshape\sffamily key\/}\verb@[i + 1] = kj;@\\
\mbox{}\verb@}@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item {\NWtxtMacroNoRef}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
Test in-text \verb@@$\langle\,${\itshape Sort \verb@key@ of size \verb@n@ for \verb@ordering@}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$\verb@@ usage.
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

259
test/00/t0016a.sh Normal file
View File

@@ -0,0 +1,259 @@
#!/bin/sh
#
# $RCSfile: t0016a.sh,v $-- Test test/00/t0016a.sh
#
#
# Test no pagebreak before scraps
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test no pagebreak before scraps" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test no pagebreak before scraps" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
@c Here comes a block comment just before a scrap and we don't
want this separated from it. (Thinks:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:)
@d Here is a scrap.
@{This is the contents of the scrap.
More stuff, not related to songs without ends.
"This is a song that will get on your nerves,
Get on your nerves,
Get on your nerves,"
Ad infinitum.
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
\begin{flushleft} \small
\begin{minipage}{\linewidth} Here comes a block comment just before a scrap and we don't
want this separated from it. (Thinks:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:
This is a song without and end. It goes on and on my friend. Some
people started singing it, not knowing what it was, and they'll
go on forever just because:)
\par\vspace{\baselineskip}
\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Here is a scrap.}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This is the contents of the scrap.@\\
\mbox{}\verb@@\\
\mbox{}\verb@More stuff, not related to songs without ends.@\\
\mbox{}\verb@@\\
\mbox{}\verb@"This is a song that will get on your nerves,@\\
\mbox{}\verb@ Get on your nerves,@\\
\mbox{}\verb@ Get on your nerves,"@\\
\mbox{}\verb@@\\
\mbox{}\verb@Ad infinitum.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item {\NWtxtMacroNoRef}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

318
test/00/t0017a.sh Normal file
View File

@@ -0,0 +1,318 @@
#!/bin/sh
#
# $RCSfile: t0017a.sh,v $-- Test test/00/t0017a.sh
#
#
# Test of quoted scraps
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of quoted scraps" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of quoted scraps" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test quoted scraps
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c -cc
@{Test of quoted fragments.
@<Insert first fragment@>
@<Insert second fragment@>
@<Insert third fragment@>
@<Insert parameter @'whatsit@'...@>
End of test.
@}
@d Insert first fragment
@{This fragment is not quoted.
@<Insert unquoted fragment@>
@<Insert quoted fragment@>
@<Insert parameter @'1@'...@>
@<Insert param...@>
End of first fragment.@}
@q Insert second fragment
@{This fragment is quoted.
@<Insert unquoted fragment@>
@<Insert quoted fragment@>
@<Insert parameter @'2@'...@>
@<Insert param...@>
End of second fragment.@}
@d Insert third fragment
@{This fragment is not quoted.
@<Insert unquoted fragment@>
@<Insert quoted fragment@>
@<Insert parameter @'3@'...@>
@<Insert param...@>
End of third fragment.@}
@d Insert unquoted fragment
@{This fragment in file @f is not quoted@}
@q Insert quoted fragment
@{This fragment in file @f is quoted@}
@d Insert parameter @'thing@' fragment
@{Here >>@1<< is the parameter@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Test of quoted fragments.@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert first fragment}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert second fragment}\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert third fragment}\nobreak\ {\footnotesize \NWlink{nuweb1d}{1d}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@whatsit@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@End of test.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Insert first fragment}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This fragment is not quoted.@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert unquoted fragment}\nobreak\ {\footnotesize \NWlink{nuweb1e}{1e}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert quoted fragment}\nobreak\ {\footnotesize \NWlink{nuweb2a}{2a}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@1@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@thing@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@End of first fragment.@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb1c}{} $\langle\,${\itshape Insert second fragment}\nobreak\ {\footnotesize {1c}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This fragment is quoted.@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert unquoted fragment}\nobreak\ {\footnotesize \NWlink{nuweb1e}{1e}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert quoted fragment}\nobreak\ {\footnotesize \NWlink{nuweb2a}{2a}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@2@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@thing@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@End of second fragment.@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb1d}{} $\langle\,${\itshape Insert third fragment}\nobreak\ {\footnotesize {1d}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This fragment is not quoted.@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert unquoted fragment}\nobreak\ {\footnotesize \NWlink{nuweb1e}{1e}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert quoted fragment}\nobreak\ {\footnotesize \NWlink{nuweb2a}{2a}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@3@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@ @\hbox{$\langle\,${\itshape Insert parameter \verb@thing@ fragment}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@End of third fragment.@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap5}\raggedright\small
\NWtarget{nuweb1e}{} $\langle\,${\itshape Insert unquoted fragment}\nobreak\ {\footnotesize {1e}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This fragment in file @\hbox{\sffamily\slshape file name}\verb@ is not quoted@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1b}{1b}\NWlink{nuweb1c}{c}\NWlink{nuweb1d}{d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap6}\raggedright\small
\NWtarget{nuweb2a}{} $\langle\,${\itshape Insert quoted fragment}\nobreak\ {\footnotesize {2a}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@This fragment in file @\hbox{\sffamily\slshape file name}\verb@ is quoted@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1b}{1b}\NWlink{nuweb1c}{c}\NWlink{nuweb1d}{d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap7}\raggedright\small
\NWtarget{nuweb2b}{} $\langle\,${\itshape Insert parameter \hbox{\slshape\sffamily thing\/} fragment}\nobreak\ {\footnotesize {2b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here >>@\hbox{\slshape\sffamily thing\/}\verb@<< is the parameter@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1b}{b}\NWlink{nuweb1c}{c}\NWlink{nuweb1d}{d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Test of quoted fragments.
/* Insert first fragment */
This fragment is not quoted.
/* Insert unquoted fragment */
This fragment in file test.c is not quoted
/* Insert quoted fragment */
This fragment in file @f is quoted
/* Insert parameter '1' fragment */
Here >>1<< is the parameter
/* Insert parameter 'thing' fragment */
Here >>thing<< is the parameter
End of first fragment.
/* Insert second fragment */
This fragment is quoted.
@<Insert unquoted fragment@>
@<Insert quoted fragment@>
@<Insert parameter @'2@' fragment@>
@<Insert parameter @'thing@' fragment@>
End of second fragment.
/* Insert third fragment */
This fragment is not quoted.
/* Insert unquoted fragment */
This fragment in file test.c is not quoted
/* Insert quoted fragment */
This fragment in file @f is quoted
/* Insert parameter '3' fragment */
Here >>3<< is the parameter
/* Insert parameter 'thing' fragment */
Here >>thing<< is the parameter
End of third fragment.
/* Insert parameter 'whatsit' fragment */
Here >>whatsit<< is the parameter
End of test.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
if test $? -ne 0 ; then fail; fi
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

150
test/00/t0018a.sh Normal file
View File

@@ -0,0 +1,150 @@
#!/bin/sh
#
# $RCSfile: t0018a.sh,v $-- Test test/00/t0018a.sh
#
#
# Test of using hyperlinks
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of using hyperlinks" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of using hyperlinks" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test using hyperlinks
#
cat > test.w <<"EOF"
\documentclass{article}
\NWuseHyperlinks
\begin{document}
@o test.c -cc
@{@<Use a fragment@>
@}
@d Use...
@{Here is a fragment.
Make sure it is referenced properly.@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{\hypertarget{#1}{#2}}
\newcommand{\NWlink}[2]{\hyperlink{#1}{#2}}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{\usepackage[pdftex,colorlinks=true]{hyperref}}
\documentclass{article}
\NWuseHyperlinks
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\hbox{$\langle\,${\itshape Use a fragment}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Use a fragment}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is a fragment.@\\
\mbox{}\verb@ Make sure it is referenced properly.@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after nuweb has run. If nuweb fails this script
# can save time by not decompressing. ]
$bin/nuweb -h "pdftex,colorlinks=true" test.w
if test $? -ne 0 ; then fail; fi
pdflatex test
if test $? -ne 0 ; then fail; fi
$bin/nuweb -h "pdftex,colorlinks=true" test.w
if test $? -ne 0 ; then fail; fi
pdflatex test
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

158
test/00/t0019a.sh Normal file
View File

@@ -0,0 +1,158 @@
#!/bin/sh
#
# $RCSfile: t0019a.sh,v $-- Test test/00/t0019a.sh
#
#
# Test of C++ comments
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of C++ comments" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of C++ comments" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test C++ comments
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
This tests C++ style comments.
@o test.cpp -c+
@{@<File header@>
@<More stuff@>
@<A little more stuff@>
@}
@d File header
@{// The comments here are explicit.
// @f
@}
@c
Here we have a lot of stuff that is going to go into a block
comment which we make long enough to spread over several lines.
Here we have a lot of stuff that is going to go into a block
comment which we make long enough to spread over several lines.
Here we have a lot of stuff that is going to go into a block
comment which we make long enough to spread over several lines.
Here we have a lot of stuff that is going to go into a block
comment which we make long enough to spread over several lines.
Here we have a lot of stuff that is going to go into a block
comment which we make long enough to spread over several lines.
Here we have a lot of stuff that is going to go into a block
comment which we make long enough to spread over several lines.
@d More stuff
@{@c
This is the body of more stuff.
@}
@d A little more stuff
@{Another check on a single-line comment.
And another check on block comments.
@<More stuff@>
That is the end of a little more stuff.
@}
\end{document}
EOF
cat > test.expected.cpp <<"EOF"
// File header
// The comments here are explicit.
// test.cpp
// More stuff
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several lines.
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several lines.
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several lines.
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several lines.
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several lines.
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several lines.
This is the body of more stuff.
// A little more stuff
Another check on a single-line comment.
And another check on block comments.
// More stuff
// Here we have a lot of stuff that is going to go into a block
// comment which we make long enough to spread over several
// lines. Here we have a lot of stuff that is going to go into
// a block comment which we make long enough to spread over
// several lines. Here we have a lot of stuff that is going
// to go into a block comment which we make long enough to
// spread over several lines. Here we have a lot of stuff that
// is going to go into a block comment which we make long enough
// to spread over several lines. Here we have a lot of stuff
// that is going to go into a block comment which we make long
// enough to spread over several lines. Here we have a lot
// of stuff that is going to go into a block comment which
// we make long enough to spread over several lines.
This is the body of more stuff.
That is the end of a little more stuff.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.cpp test.cpp
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

126
test/00/t0020a.sh Normal file
View File

@@ -0,0 +1,126 @@
#!/bin/sh
#
# $RCSfile: t0020a.sh,v $-- Test test/00/t0020a.sh
#
#
# Test of include paths
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of include paths" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of include paths" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test include paths
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Here is the main.
@i testincl.w
Still in main
@i incltest.w
End in main.
\end{document}
EOF
cat >testincl.w <<"EOF"
Here is top level include file.
EOF
cat >incltest.w <<"EOF"
Here is include file that must be searched for.
EOF
mkdir lvl1
if test $? -ne 0 ; then no_result; fi
mkdir lvl1/lvl2
if test $? -ne 0 ; then no_result; fi
mv incltest.w lvl1/lvl2
if test $? -ne 0 ; then no_result; fi
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here is the main.
Here is top level include file.
Still in main
Here is include file that must be searched for.
End in main.
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb -I lvl1 -I lvl1/lvl2 test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

126
test/00/t0021a.sh Normal file
View File

@@ -0,0 +1,126 @@
#!/bin/sh
#
# $RCSfile: t0021a.sh,v $-- Test test/00/t0020a.sh
#
#
# Test of include paths
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of include paths" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of include paths" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test include paths
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Here is the main.
@i testincl.w
Still in main
@i incltest.w
End in main.
\end{document}
EOF
cat >testincl.w <<"EOF"
Here is top level include file.
EOF
cat >incltest.w <<"EOF"
Here is include file that must be searched for.
EOF
mkdir lvl1
if test $? -ne 0 ; then no_result; fi
mkdir lvl1/lvl2
if test $? -ne 0 ; then no_result; fi
mv incltest.w lvl1/lvl2
if test $? -ne 0 ; then no_result; fi
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here is the main.
Here is top level include file.
Still in main
Here is include file that must be searched for.
End in main.
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb -Ilvl1 -Ilvl1/lvl2 test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

111
test/00/t0022a.sh Normal file
View File

@@ -0,0 +1,111 @@
#!/bin/sh
#
# $RCSfile: t0022a.sh,v $-- Test test/00/t0022a.sh
#
#
# Test that missing includes don't bomb
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test that missing includes don't bomb" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test that missing includes don't bomb" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Here follows a file that exists.
@i exist.w
Here follows a file that doesn't exist.
@i non-exist.w
No more files.
\end{document}
EOF
cat >exist.w <<"EOF"
Here is the existing file.
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Here follows a file that exists.
Here is the existing file.
Here follows a file that doesn't exist.
No more files.
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

110
test/00/t0023a.sh Normal file
View File

@@ -0,0 +1,110 @@
#!/bin/sh
#
# $RCSfile: t0023a.sh,v $-- Test test/00/t0023a.sh
#
#
# Test Perl comments
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test Perl comments" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test Perl comments" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@c
Here is a block comment that takes many lines.
Here is a block comment that takes many lines.
Here is a block comment that takes many lines.
Here is a block comment that takes many lines.
@o test -cp
@{@<First stuff@>
Now a block comment.
@c
@<Second stuff@>
End
@}
@d First...
@{This is the body of first stuff.
@}
@d Second...
@{Yes, it's the second stuff.
@}
\end{document}
EOF
cat > test.expected <<"EOF"
# First stuff
This is the body of first stuff.
Now a block comment.
# Here is a block comment that takes many lines. Here is a block
# comment that takes many lines. Here is a block comment that
# takes many lines. Here is a block comment that takes many lines.
# Second stuff
Yes, it's the second stuff.
End
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected test
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

397
test/00/t0024a.sh Normal file
View File

@@ -0,0 +1,397 @@
#!/bin/sh
#
# $RCSfile: t0024a.sh,v $-- Test test/00/t0024a.sh
#
#
# Test of Local and global sectors
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Local and global sectors" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Local and global sectors" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Local and global sectors
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.actual.c
@{ First use in global
@<Frag 1@>
@}
@d Frag 1
@{Global sector line one.
@}
@s
@d Frag 1
@{First sector line one.
@}
@o test.actual.c
@{Use first local
@<Frag 1@>
@}
@m
@s
@o test.actual.c
@{Use second local
@<Frag 1@>
@}
@d Frag 1
@{Second sector line one.
@}
@m
@S
@d Frag 1
@{Global sector line two.
@}
@s
@d Frag 1
@{Third sector line one.
@}
@o test.actual.c
@{Use second local
@<Frag 1@>
@}
@m
@S
@d Frag 1
@{Global sector line three.
@}
@o test.actual.c
@{ Last use in global
@<Frag 1@>
@}
@m
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@ First use in global@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}, \ldots\ }$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Global sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb1c}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {1c}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@First sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1d}{1d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb1d}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {1d}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use first local@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1d}{1d}.}
\end{list}}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap5}\raggedright\small
\NWtarget{nuweb1e}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {1e}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use second local@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1f}{1f}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap6}\raggedright\small
\NWtarget{nuweb1f}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {1f}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Second sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1e}{1e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb1f}{1f}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1e}{1e}.}
\end{list}}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap7}\raggedright\small
\NWtarget{nuweb2a}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {2a}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Global sector line two.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap8}\raggedright\small
\NWtarget{nuweb2b}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {2b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Third sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb2c}{2c}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap9}\raggedright\small
\NWtarget{nuweb2c}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {2c}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use second local@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb2c}{2c}.}
\end{list}}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap10}\raggedright\small
\NWtarget{nuweb2d}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {2d}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Global sector line three.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap11}\raggedright\small
\NWtarget{nuweb2e}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {2e}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@ Last use in global@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}, \ldots\ }$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
}
\end{list}}
\end{document}
EOF
cat > test.expected.c <<"EOF"
First use in global
Global sector line one.
Global sector line two.
Global sector line three.
Use first local
First sector line one.
Use second local
Second sector line one.
Use second local
Third sector line one.
Last use in global
Global sector line one.
Global sector line two.
Global sector line three.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
if test $? -ne 0 ; then fail; fi
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.actual.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

426
test/00/t0025a.sh Normal file
View File

@@ -0,0 +1,426 @@
#!/bin/sh
#
# $RCSfile: t0025a.sh,v $-- Test test/00/t0024a.sh
#
#
# Test of Local and global sectors
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Local and global sectors" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Local and global sectors" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Local and global sectors
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.actual.c
@{ First use in global
@<Frag 1@>
@}
@d Frag 1
@{Base sector line one.
@}
@s
@d Frag 1
@{First sector line one.
@}
@o test.actual.c
@{Use first local
@<Frag 1@>
@<+ Frag 2@>
@}
@m
@s
@o test.actual.c
@{Use second local
@<Frag 1@>
@}
@d Frag 1
@{Second sector line one.
@}
@m
@S
@d Frag 1
@{Base sector line two.
@}
@s
@d Frag 1
@{Third sector line one.
@}
@o test.actual.c
@{Use second local
@<Frag 1@>
@}
@m
@S
@d Frag 1
@{Base sector line three.
@}
@o test.actual.c
@{ Last use in global
@<Frag 1@>
@}
@d+ Frag 2
@{Here is frag 2
@}
@m
@m+
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@ First use in global@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}, \ldots\ }$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Base sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb1c}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {1c}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@First sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1d}{1d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb1d}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {1d}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use first local@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 2}\nobreak\ {\footnotesize \NWlink{nuweb2f}{2f}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1d}{1d}.}
\end{list}}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap5}\raggedright\small
\NWtarget{nuweb1e}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {1e}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use second local@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1f}{1f}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap6}\raggedright\small
\NWtarget{nuweb1f}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {1f}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Second sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1e}{1e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb1f}{1f}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1e}{1e}.}
\end{list}}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap7}\raggedright\small
\NWtarget{nuweb2a}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {2a}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Base sector line two.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap8}\raggedright\small
\NWtarget{nuweb2b}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {2b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Third sector line one.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb2c}{2c}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap9}\raggedright\small
\NWtarget{nuweb2c}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {2c}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Use second local@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb2b}{2b}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb2c}{2c}.}
\end{list}}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap10}\raggedright\small
\NWtarget{nuweb2d}{} $\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize {2d}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Base sector line three.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap11}\raggedright\small
\NWtarget{nuweb2e}{} \verb@"test.actual.c"@\nobreak\ {\footnotesize {2e}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@ Last use in global@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag 1}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}, \ldots\ }$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}\NWlink{nuweb1e}{e}\NWlink{nuweb2c}{, 2c}\NWlink{nuweb2e}{e}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap12}\raggedright\small
\NWtarget{nuweb2f}{} $\langle\,${\itshape Frag 2}\nobreak\ {\footnotesize {2f}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is frag 2@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1d}{1d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 1\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}\NWlink{nuweb2a}{, 2a}\NWlink{nuweb2d}{d}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1a}{1a}\NWlink{nuweb2e}{, 2e}.
}
\end{list}}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Frag 2\nobreak\ {\footnotesize \NWlink{nuweb2f}{2f}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1d}{1d}.}
\end{list}}
\end{document}
EOF
cat > test.expected.c <<"EOF"
First use in global
Base sector line one.
Base sector line two.
Base sector line three.
Use first local
First sector line one.
Here is frag 2
Use second local
Second sector line one.
Use second local
Third sector line one.
Last use in global
Base sector line one.
Base sector line two.
Base sector line three.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
if test $? -ne 0 ; then fail; fi
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.actual.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

118
test/00/t0026a.sh Normal file
View File

@@ -0,0 +1,118 @@
#!/bin/sh
#
# $RCSfile: t0026a.sh,v $-- Test test/00/t0026a.sh
#
#
# Test of ???
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of ???" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of ???" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test ???
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.actual.c
@{ First use in global
@<Frag 1@>
@}
@d Frag 1
@{Base sector line one.
@}
@s
@d Frag 1
@{First sector line one.
@}
@o test.actual.c
@{@<Frag 3@>
@}
@q Frag 3
@{Use first local
@<Frag 1@>
@<+ Frag 2@>
@}
@m
@S
@d Frag 1
@{Base sector line two.
@}
@d+ Frag 2
@{Here is frag 2
@}
@m
@m+
\end{document}
EOF
cat > test.expected.c <<"EOF"
First use in global
Base sector line one.
Base sector line two.
Use first local
@<Frag 1@>
@<+Frag 2@>
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.actual.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

127
test/00/t0027a.sh Normal file
View File

@@ -0,0 +1,127 @@
#!/bin/sh
#
# $RCSfile: t0027a.sh,v $-- Test test/00/t0027a.sh
#
#
# Test of nested global macros
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of nested global macros" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of nested global macros" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test nested global macros
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.actual.c
@{ First use in global
@<Frag 1@>
@}
@d Frag 1
@{Base sector line one.
@}
@d Frag 4 uses @'thing@'
@{Access @1
@}
@q Frag 5
@{@<Frag 4 uses @<+Frag 2@>@>
@}
@s
@d Frag 1
@{First sector line one.
@}
@o test.actual.c
@{@<Frag 3@>
@}
@q Frag 3
@{Use first local
@<Frag 1@>
@<+ Frag 2@>
@}
@m
@S
@d Frag 1
@{Base sector line two.
@<Frag 5@>
@}
@d+ Frag 2
@{Here is frag 2
@}
@m
@m+
\end{document}
EOF
cat > test.expected.c <<"EOF"
First use in global
Base sector line one.
Base sector line two.
@<Frag 4 uses @<+Frag 2@>@>
Use first local
@<Frag 1@>
@<+Frag 2@>
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.actual.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

157
test/00/t0028a.sh Normal file
View File

@@ -0,0 +1,157 @@
#!/bin/sh
#
# $RCSfile: t0028a.sh,v $-- Test test/00/t0028a.sh
#
#
# Test of Maths in arguments
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Maths in arguments" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Maths in arguments" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Maths in arguments
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@d Frag with @'arg1@' and @'$arg2@'
@{Here is the first arg:@1.
Here is the second arg:@2.
@}
@o test.c -cc
@{Front
@<Frag with @'$tuff@' and @'Non_sense@'@>
Back
@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Frag with \hbox{\slshape\sffamily arg1\/} and \hbox{\slshape\sffamily \$arg2\/}}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is the first arg:@\hbox{\slshape\sffamily arg1\/}\verb@.@\\
\mbox{}\verb@Here is the second arg:@\hbox{\slshape\sffamily \$arg2\/}\verb@.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Front@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Frag with \verb@$tuff@ and \verb@Non_sense@}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@Back@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Front
/* Frag with '$tuff' and 'Non_sense' */
Here is the first arg:$tuff.
Here is the second arg:Non_sense.
Back
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

301
test/00/t0029a.sh Normal file
View File

@@ -0,0 +1,301 @@
#!/bin/sh
#
# $RCSfile: t0029a.sh,v $-- Test test/00/t0029a.sh
#
#
# Test of Bar in fragment names is invisible
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Bar in fragment names is invisible" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Bar in fragment names is invisible" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Bar in fragment names is invisible
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@d Atom
@{@}
@d atom
@{@}
@d Atomic
@{@}
@d atomi...
@{
@}
@d Save |file| abc
@{@}
@d Save file uvw
@{@}
@d Adam
@{@}
@d atoms
@{@}
@o test.c
@{@<Atom@>
@<atom@>
@<Save |file| abc@>
@<Save file uvw@>
@<Adam@>
@<atomic@>
@<atoms@>
@<Atomic@>
@}
@m
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Atom}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape atom}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Atomic}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape atomic}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap5}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Save |file| abc}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap6}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Save file uvw}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap7}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Adam}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap8}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape atoms}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap9}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\hbox{$\langle\,${\itshape Atom}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape atom}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Save |file| abc}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Save file uvw}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Adam}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape atomic}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape atoms}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Atomic}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Adam\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$Atom\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$atom\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$Atomic\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$atomic\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$atoms\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$Save |file| abc\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\item $\langle\,$Save file uvw\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb?}{?}.}
\end{list}}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

194
test/00/t0032a.sh Normal file
View File

@@ -0,0 +1,194 @@
#!/bin/sh
#
# $RCSfile: t0032a.sh,v $-- Test test/00/t0032a.sh
#
#
# Test of Embedded fragments as arguments
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Embedded fragments as arguments" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Embedded fragments as arguments" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Embedded fragments as arguments
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c -cc
@{Begin
@<Outer @'abc@' and @'def@' retuO@>
@<Outer @'cba@' and @'fed@' retuO@>
End
@}
@d Outer @'Arg1@' and @'Arg2@' retuO
@{Start
@<Inner @{x@1y@2z@} rennI@>
Finish
@}
@d Inner @'Stuff@' rennI
@{XX>>@1<<YY@}
@m
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Begin@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Outer \verb@abc@ and \verb@def@ retuO}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Outer \verb@cba@ and \verb@fed@ retuO}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@End@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Outer \hbox{\slshape\sffamily Arg1\/} and \hbox{\slshape\sffamily Arg2\/} retuO}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Start@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Inner \verb@xArg1yArg2z@ rennI}\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$}\verb@@\\
\mbox{}\verb@Finish@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb1c}{} $\langle\,${\itshape Inner \hbox{\slshape\sffamily Stuff\/} rennI}\nobreak\ {\footnotesize {1c}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@XX>>@\hbox{\slshape\sffamily Stuff\/}\verb@<<YY@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1b}{1b}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Inner \hbox{\slshape\sffamily Stuff\/} rennI\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1b}{1b}.}
\item $\langle\,$Outer \hbox{\slshape\sffamily Arg1\/} and \hbox{\slshape\sffamily Arg2\/} retuO\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1a}{1a}.}
\end{list}}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Begin
/* Outer 'abc' and 'def' retuO */
Start
/* Inner {xabcydefz} rennI */
XX>>xabcydefz<<YY
Finish
/* Outer 'cba' and 'fed' retuO */
Start
/* Inner {xcbayfedz} rennI */
XX>>xcbayfedz<<YY
Finish
End
EOF
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
latex test
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

257
test/00/t0033a.sh Normal file
View File

@@ -0,0 +1,257 @@
#!/bin/sh
#
# $RCSfile: t0033a.sh,v $-- Test test/00/t0032a.sh
#
#
# Test of Cross-reference environment
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Cross-reference environment" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Cross-reference environment" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Cross-reference environment
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@o test.c -cc
@{Begin
Define abc cba
@<Outer @'abc@' and @'def@' retuO@>
@<Outer @'cba@' and @'fed@' retuO@>
End
@| abc cba @}
@d Outer @'Arg1@' and @'Arg2@' retuO
@{Start
Define def fed
Use abc cba
@<Inner @{x@1y@2z@} rennI@>
Finish
@| def fed@}
@d Inner @'Stuff@' rennI
@{XX>>@1<<YY@}
@o test.c -cc
@{More stuff
@}
@d Outer...
@{Added stuff to force fragment defined
cross-reference entry.
@}
@m
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Begin@\\
\mbox{}\verb@Define abc cba@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Outer \verb@abc@ and \verb@def@ retuO}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}, \ldots\ }$\,\rangle$}\verb@@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Outer \verb@cba@ and \verb@fed@ retuO}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}, \ldots\ }$\,\rangle$}\verb@@\\
\mbox{}\verb@End@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}.
\item \NWtxtIdentsDefed\nobreak\ \verb@abc@\nobreak\ \NWlink{nuweb1b}{1b}, \verb@cba@\nobreak\ \NWlink{nuweb1b}{1b}.\item \NWtxtIdentsUsed\nobreak\ \verb@def@\nobreak\ \NWlink{nuweb1b}{1b}, \verb@fed@\nobreak\ \NWlink{nuweb1b}{1b}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Outer \hbox{\slshape\sffamily Arg1\/} and \hbox{\slshape\sffamily Arg2\/} retuO}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Start@\\
\mbox{}\verb@Define def fed@\\
\mbox{}\verb@Use abc cba@\\
\mbox{}\verb@@\hbox{$\langle\,${\itshape Inner \verb@xArg1yArg2z@ rennI}\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$}\verb@@\\
\mbox{}\verb@Finish@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb1e}{e}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item \NWtxtIdentsDefed\nobreak\ \verb@def@\nobreak\ \NWlink{nuweb1a}{1a}, \verb@fed@\nobreak\ \NWlink{nuweb1a}{1a}.\item \NWtxtIdentsUsed\nobreak\ \verb@abc@\nobreak\ \NWlink{nuweb1a}{1a}, \verb@cba@\nobreak\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap4}\raggedright\small
\NWtarget{nuweb1c}{} $\langle\,${\itshape Inner \hbox{\slshape\sffamily Stuff\/} rennI}\nobreak\ {\footnotesize {1c}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@XX>>@\hbox{\slshape\sffamily Stuff\/}\verb@<<YY@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1b}{1b}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap5}\raggedright\small
\NWtarget{nuweb1d}{} \verb@"test.c"@\nobreak\ {\footnotesize {1d}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@More stuff@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtFileDefBy\ \NWlink{nuweb1a}{1a}\NWlink{nuweb1d}{d}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap6}\raggedright\small
\NWtarget{nuweb1e}{} $\langle\,${\itshape Outer \hbox{\slshape\sffamily Arg1\/} and \hbox{\slshape\sffamily Arg2\/} retuO}\nobreak\ {\footnotesize {1e}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Added stuff to force fragment defined@\\
\mbox{}\verb@cross-reference entry.@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroDefBy\ \NWlink{nuweb1b}{1b}\NWlink{nuweb1e}{e}.
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Inner \hbox{\slshape\sffamily Stuff\/} rennI\nobreak\ {\footnotesize \NWlink{nuweb1c}{1c}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1b}{1b}.}
\item $\langle\,$Outer \hbox{\slshape\sffamily Arg1\/} and \hbox{\slshape\sffamily Arg2\/} retuO\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}\NWlink{nuweb1e}{e}}$\,\rangle$ {\footnotesize {\NWtxtRefIn} \NWlink{nuweb1a}{1a}.}
\end{list}}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Begin
Define abc cba
/* Outer 'abc' and 'def' retuO 1b */
Start
Define def fed
Use abc cba
/* Inner {xabcydefz} rennI 1c */
XX>>xabcydefz<<YY
Finish
Added stuff to force fragment defined
cross-reference entry.
/* Outer 'cba' and 'fed' retuO 1b */
Start
Define def fed
Use abc cba
/* Inner {xcbayfedz} rennI 1c */
XX>>xcbayfedz<<YY
Finish
Added stuff to force fragment defined
cross-reference entry.
End
More stuff
EOF
$bin/nuweb -x test.w
if test $? -ne 0 ; then fail; fi
latex test
$bin/nuweb -x test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

195
test/00/t0034a.sh Normal file
View File

@@ -0,0 +1,195 @@
#!/bin/sh
#
# $RCSfile: t0034a.sh,v $-- Test test/00/t0034a.sh
#
#
# Test of Listing package
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Listing package" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Listing package" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Listing package
#
cat > test.w <<"EOF"
\documentclass{article}
\usepackage{listings}
\begin{document}
\lstset{extendedchars=true,keepspaces=true,language=C}
@o test.c -cc
@{int
main(int argc, char ** argv)
{
@<Body of main@>
}
@}
@d Body...
@{int in;
unsigned char out[20];
while (scanf("%x", &in) == 1)
{
@<Do one item@>
}
return 0;@}
@d Do...
@{int n = mangle(in, out);
for (int i = 0; i < n; i++)
printf("%02x", out[i]);
printf("\n");@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\usepackage{listings}
\begin{document}
\lstset{extendedchars=true,keepspaces=true,language=C}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} \verb@"test.c"@\nobreak\ {\footnotesize {?}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\lstinline@int@\\
\mbox{}\lstinline@main(int argc, char ** argv)@\\
\mbox{}\lstinline@{@\\
\mbox{}\lstinline@ @\hbox{$\langle\,${\itshape Body of main}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\lstinline@@\\
\mbox{}\lstinline@}@\\
\mbox{}\lstinline@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Body of main}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\lstinline@int in;@\\
\mbox{}\lstinline@unsigned char out[20];@\\
\mbox{}\lstinline@@\\
\mbox{}\lstinline@while (scanf("%x", &in) == 1)@\\
\mbox{}\lstinline@{@\\
\mbox{}\lstinline@ @\hbox{$\langle\,${\itshape Do one item}\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$}\lstinline@@\\
\mbox{}\lstinline@}@\\
\mbox{}\lstinline@return 0;@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap3}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Do one item}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\lstinline@int n = mangle(in, out);@\\
\mbox{}\lstinline@@\\
\mbox{}\lstinline@for (int i = 0; i < n; i++)@\\
\mbox{}\lstinline@ printf("%02x", out[i]);@\\
\mbox{}\lstinline@printf("\n");@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb?}{?}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb -l test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

150
test/00/t0035a.sh Normal file
View File

@@ -0,0 +1,150 @@
#!/bin/sh
#
# $RCSfile: t0035a.sh,v $-- Test test/00/t0018a.sh
#
#
# Test of hyperlinks using -r
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of hyperlinks using -r" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of hyperlinks using -r" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test hyperlinks using -r
#
cat > test.w <<"EOF"
\documentclass{article}
\usepackage[pdftex,colorlinks=true]{hyperref}
\begin{document}
@o test.c -cc
@{@<Use a fragment@>
@}
@d Use...
@{Here is a fragment.
Make sure it is referenced properly.@}
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{\hypertarget{#1}{#2}}
\newcommand{\NWlink}[2]{\hyperlink{#1}{#2}}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\usepackage[pdftex,colorlinks=true]{hyperref}
\begin{document}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb1a}{} \verb@"test.c"@\nobreak\ {\footnotesize {1a}}$\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@@\hbox{$\langle\,${\itshape Use a fragment}\nobreak\ {\footnotesize \NWlink{nuweb1b}{1b}}$\,\rangle$}\verb@@\\
\mbox{}\verb@@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap2}\raggedright\small
\NWtarget{nuweb1b}{} $\langle\,${\itshape Use a fragment}\nobreak\ {\footnotesize {1b}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Here is a fragment.@\\
\mbox{}\verb@ Make sure it is referenced properly.@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item \NWtxtMacroRefIn\ \NWlink{nuweb1a}{1a}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after nuweb has run. If nuweb fails this script
# can save time by not decompressing. ]
$bin/nuweb -r test.w
if test $? -ne 0 ; then fail; fi
pdflatex test
if test $? -ne 0 ; then fail; fi
$bin/nuweb -r test.w
if test $? -ne 0 ; then fail; fi
pdflatex test
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

129
test/00/t0036a.sh Normal file
View File

@@ -0,0 +1,129 @@
#!/bin/sh
#
# $RCSfile: t0036a.sh,v $-- Test test/00/t0036a.sh
#
#
# Test of Empty macro index
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of Empty macro index" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of Empty macro index" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test Empty macro index
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
Test text.
@d Fragment one
@{Stuff 1@}
@s
No fragments here.
@m
@S
@m
\end{document}
EOF
cat > test.expected.tex <<"EOF"
\newcommand{\NWtarget}[2]{#2}
\newcommand{\NWlink}[2]{#2}
\newcommand{\NWtxtMacroDefBy}{Fragment defined by}
\newcommand{\NWtxtMacroRefIn}{Fragment referenced in}
\newcommand{\NWtxtMacroNoRef}{Fragment never referenced}
\newcommand{\NWtxtDefBy}{Defined by}
\newcommand{\NWtxtRefIn}{Referenced in}
\newcommand{\NWtxtNoRef}{Not referenced}
\newcommand{\NWtxtFileDefBy}{File defined by}
\newcommand{\NWtxtIdentsUsed}{Uses:}
\newcommand{\NWtxtIdentsNotUsed}{Never used}
\newcommand{\NWtxtIdentsDefed}{Defines:}
\newcommand{\NWsep}{${\diamond}$}
\newcommand{\NWnotglobal}{(not defined globally)}
\newcommand{\NWuseHyperlinks}{}
\documentclass{article}
\begin{document}
Test text.
\begin{flushleft} \small
\begin{minipage}{\linewidth}\label{scrap1}\raggedright\small
\NWtarget{nuweb?}{} $\langle\,${\itshape Fragment one}\nobreak\ {\footnotesize {?}}$\,\rangle\equiv$
\vspace{-1ex}
\begin{list}{}{} \item
\mbox{}\verb@Stuff 1@{\NWsep}
\end{list}
\vspace{-1.5ex}
\footnotesize
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item {\NWtxtMacroNoRef}.
\item{}
\end{list}
\end{minipage}\vspace{4ex}
\end{flushleft}
No fragments here.
None.
{\small\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
\item $\langle\,$Fragment one\nobreak\ {\footnotesize \NWlink{nuweb?}{?}}$\,\rangle$ {\footnotesize {\NWtxtNoRef}.}
\end{list}}
\end{document}
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.tex test.tex
if test $? -ne 0 ; then fail; fi
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass

119
test/00/t0037a.sh Normal file
View File

@@ -0,0 +1,119 @@
#!/bin/sh
#
# $RCSfile: t0037a.sh,v $-- Test test/00/t0006a.sh
#
#
# Test of big definitions
#
work=${TMPDIR:-/tmp}/$$
PAGER=cat
export PAGER
umask 022
here=`pwd`
if test $? -ne 0 ; then exit 2; fi
SHELL=/bin/sh
export SHELL
bin="$here/${1-.}"
pass()
{
set +x
cd $here
rm -rf $work
exit 0
}
fail()
{
set +x
echo "FAILED test of big definitions" 1>&2
cd $here
rm -rf $work
exit 1
}
no_result()
{
set +x
echo "NO RESULT for test of big definitions" 1>&2
cd $here
rm -rf $work
exit 2
}
trap \"no_result\" 1 2 3 15
mkdir $work
if test $? -ne 0 ; then no_result; fi
cd $work
if test $? -ne 0 ; then no_result; fi
#
# test big definitions
#
cat > test.w <<"EOF"
\documentclass{article}
\begin{document}
@O test.c -cc
@{Call the macro
@<Fragment with @<A macro argument@> as parameter@>
@<Second frag with @<A macro argument@> as parameter@>
@<Third frag with @<A macro argument@> as parameter@>
@}
@D Fragment with @'Begin macro@'...
@{@1<<<Here 'tis.
That argument was at the beginning of the fragment@}
@D Second frag with @'Begin line@'...
@{Here is the beginning of the second macro
@1<<<That is the argument
And this is the end of the second frag@}
@D Third frag with @'Embedded@'...
@{Here is the argument>>>@1<<<That was it.@}
@D A macro argument
@{Hello folks@}
\end{document}
EOF
cat > test.expected.c <<"EOF"
Call the macro
/* Fragment with <A macro argument> as parameter 1b */
/* A macro argument 1e */
Hello folks<<<Here 'tis.
That argument was at the beginning of the fragment
/* Second frag with <A macro argument> as parameter 1c */
Here is the beginning of the second macro
/* A macro argument 1e */
Hello folks<<<That is the argument
And this is the end of the second frag
/* Third frag with <A macro argument> as parameter 1d */
Here is the argument>>>Hello folks<<<That was it.
EOF
# [Add other files here. Avoid any extra processing such as
# decompression until after demo has run. If demo fails this script
# can save time by not decompressing. ]
$bin/nuweb -x test.w
if test $? -ne 0 ; then fail; fi
latex test
$bin/nuweb -x test.w
if test $? -ne 0 ; then fail; fi
diff -a --context test.expected.c test.c
if test $? -ne 0 ; then fail; fi
# [Add other sub-tests that might be failed here. If they need files
# created above to be decompressed, decompress them here ; this saves
# time if demo fails or the text-based sub-test fails.]
#
# Only definite negatives are possible.
# The functionality exercised by this test appears to work,
# no other guarantees are made.
#
pass