Skip to content

Commit

Permalink
Environment version of \TEST (see #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jun 29, 2017
1 parent 09ab41d commit 95d761c
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions l3build.dtx
Expand Up @@ -776,6 +776,9 @@
% \cs{TESTEXP} surrounds its contents with \cs{TYPE} and formatting to match \cs{TEST}; this can be used as a shorthand to test expandable commands.
% \item
% TODO: would a \cs{TESTFEXP} command (based on \cs{romannumeral} expansion) be useful as well?
% \item
% \cs{STARTTEST}\marg{title} \dots \cs{ENDTEST} is an environment form of
% \cs{TEST}, allowing verbatim material, \emph{etc.} to appear.
% \end{itemize}
% An example of some of these commands is shown following.
% \begin{Verbatim}
Expand Down Expand Up @@ -1492,7 +1495,18 @@
% \end{macro}
%
% \begin{macro}
% {\SEPARATOR, \TEST, \TESTEXP, \TRUE, \FALSE, \YES, \NO, \NEWLINE}
% {
% \SEPARATOR,
% \STARTTEST,
% \ENDTEST,
% \TEST,
% \TESTEXP,
% \TRUE,
% \FALSE,
% \YES,
% \NO,
% \NEWLINE
% }
% We are not starved for space in the log file output, so let's make it as
% verbose as is useful when reading the |.diff|'s.
% \begin{macrocode}
Expand All @@ -1501,30 +1515,29 @@
============================================================%
}%
}
\long\def\TEST#1#2{%
\protected\long\def\STARTTEST#1{%
\global\advance\gTESTint by 1 %
\SEPARATOR
\LONGTYPEOUT{TEST \the\gTESTint: \detokenize{#1}}%
\SEPARATOR
\begingroup
\let\TYPE\LONGTYPEOUT
#2%

}
\protected\long\def\ENDTEST{%
\endgroup
\SEPARATOR
\LONGTYPEOUT{}%
}
\long\def\TEST#1#2{%
\STARTTEST
#2%
\ENDTEST
}
\long\def\TESTEXP#1#2{%
\global\advance\gTESTint by 1 %
\SEPARATOR
\LONGTYPEOUT{%
TEST \the\gTESTint: \detokenize{#1}}%
\SEPARATOR
\begingroup
\long\def\TYPE##1{##1}%
\LONGTYPEOUT{#2}%
\endgroup
\SEPARATOR
\LONGTYPEOUT{}%
\STARTTEST
\LONGTYPEOUT{#2}%
\ENDTEST
}
\def \TRUE {\TYPE{TRUE}}
\def \FALSE {\TYPE{FALSE}}
Expand Down

0 comments on commit 95d761c

Please sign in to comment.