\documentclass{article}
\usepackage{axiom,url}
\begin{document}
\title{\$SPAD/src/input unittest.input}
\author{Martin Rubey}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{Testing unittest.spad.pamphlet}
We want to test whether the testing facility work correctly.

<<*>>=
)set break resume
)expose UnittestCount UnittestAux Unittest
testsuite "unittest"
<<TEST testLibraryError>>
<<TEST testEquals>>
@

<<*>>=
expected() ==
--    messagePrint("testsuite | testcases: failed (total) | tests: failed (total)")$OutputForm
--    messagePrint("unittest                    1     (1)               1     (4)")$OutputForm
--    messagePrint("=============================================================================")$OutputForm
    messagePrint("File summary.")$OutputForm
    messagePrint("unexpected failures: 3")$OutputForm
    messagePrint("expected failures: 3")$OutputForm
    messagePrint("unexpected passes: 2")$OutputForm
    messagePrint("total tests: 10")$OutputForm

statistics()
expected()
@
\subsection{testLibraryError}
<<TEST testLibraryError>>=
testcase "testLibraryError"

-- pass
testLibraryError("1/0")

-- unexpected failure
testLibraryError("2")

-- unexpected pass
xftestLibraryError("3/0")

-- expected failure
xftestLibraryError("4")
@

<<TEST testEquals>>=
testcase "testEquals"
-- pass
testEquals("1", "1")

-- unexpected failure
testEquals("2", "0")

-- unexpected fatal failure
testEquals("3/0", "0")

-- unexpected pass
xftestEquals("4", "4")

-- expected failure
xftestEquals("5", "0")

-- expected fatal failure
xftestEquals("6/0", "0")
@

\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
