summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex')
-rw-r--r--Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex139
1 files changed, 92 insertions, 47 deletions
diff --git a/Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex b/Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex
index cdb6d689302..2d35854a467 100644
--- a/Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex
+++ b/Master/texmf-dist/doc/latex/oberdiek/test/letltxmacro-test2.tex
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2008 by
+%% Copyright (C) 2008, 2010 by
%% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%%
%% This work may be distributed and/or modified under the
@@ -35,7 +35,7 @@
\nofiles
\documentclass{minimal}
-\usepackage{letltxmacro}[2008/06/24]
+\usepackage{letltxmacro}[2010/09/02]
\usepackage{qstest}
\IncludeTests{*}
@@ -84,37 +84,59 @@
}
\begin{qstest}{robust}{robust}
- \DeclareRobustCommand*{\TestA}{Test}%
- \SaveA
- \TestDef{TestA}{\protect \TestA }%
- \CheckA
+ \begingroup
+ \DeclareRobustCommand*{\TestA}{Test}%
+ \SaveA
+ \TestDef{TestA}{\protect \TestA }%
+ \CheckA
+ \DeclareRobustCommand{\TestA}{Test}%
+ \SaveA
+ \TestDef{TestA}{\protect \TestA }%
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\protect \TestB }%
+ \TestEquals{TestB }{TestA }%
+ \CheckA
+ \GlobalLetLtxMacro\TestC\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestC}{\protect \TestC }%
\DeclareRobustCommand{\TestA}{Test}%
- \SaveA
- \TestDef{TestA}{\protect \TestA }%
- \LetLtxMacro\TestB\TestA
- \TestDef{TestB}{\protect \TestB }%
- \TestEquals{TestB }{TestA }%
- \CheckA
+ \TestEquals{TestC }{TestA }%
\end{qstest}
\begin{qstest}{default}{default}
- \newcommand{\TestA}[1][\relax default \empty]{TestA #1}%
- \SaveA
- \TestDef
- {TestA}{\@protected@testopt \TestA \\TestA {\relax default \empty }}%
- \LetLtxMacro\TestB\TestA
+ \begingroup
+ \newcommand{\TestA}[1][\relax default \empty]{TestA #1}%
+ \SaveA
+ \TestDef
+ {TestA}{\@protected@testopt \TestA \\TestA {\relax default \empty }}%
+ \LetLtxMacro\TestB\TestA
+ \TestDef
+ {TestB}{\@protected@testopt \TestB \\TestB {\relax default \empty }}%
+ \CheckA
+ \TestEquals{\string\TestB}{\string\TestA}%
+ \GlobalLetLtxMacro\TestC\TestA
+ \CheckA
+ \endgroup
\TestDef
- {TestB}{\@protected@testopt \TestB \\TestB {\relax default \empty }}%
- \CheckA
+ {TestC}{\@protected@testopt \TestC \\TestC {\relax default \empty }}%
+ \newcommand{\TestA}[1][\relax default \empty]{TestA #1}%
+ \TestEquals{\string\TestC}{\string\TestA}%
\end{qstest}
\begin{qstest}{robustdefault}{robustdefault}
- \DeclareRobustCommand{\TestA}[1][\default]{TestA}%
- \SaveA
- \LetLtxMacro\TestB\TestA
- \TestDef{TestB}{\protect \TestB }%
- \TestDef{TestB }{\@protected@testopt \TestB \\TestB {\default }}%
- \CheckA
+ \begingroup
+ \DeclareRobustCommand{\TestA}[1][\default]{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\protect \TestB }%
+ \TestDef{TestB }{\@protected@testopt \TestB \\TestB {\default }}%
+ \CheckA
+ \GlobalLetLtxMacro\TestC\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestC}{\protect \TestC }%
+ \TestDef{TestC }{\@protected@testopt \TestC \\TestC {\default }}%
\end{qstest}
\begin{qstest}{plain}{plain}
@@ -135,39 +157,62 @@
\usepackage{etoolbox}[2008/06/22]
\begin{qstest}{oldnewrobustcmd}{oldnewrobustcmd}
- \protected\edef\TestA{%
- \noexpand\@protected@testopt
- \noexpand\TestA
- \expandafter\noexpand\csname\string\TestA\endcsname
- {\noexpand\default}%
- }%
- \expandafter\protected\expandafter
- \def\csname\string\TestA\endcsname{TestA}%
- \SaveA
- \LetLtxMacro\TestB\TestA
- \TestDef{TestB}{\@protected@testopt \TestB \\TestB {\default }}%
+ \begingroup
+ \protected\edef\TestA{%
+ \noexpand\@protected@testopt
+ \noexpand\TestA
+ \expandafter\noexpand\csname\string\TestA\endcsname
+ {\noexpand\default}%
+ }%
+ \expandafter\protected\expandafter
+ \def\csname\string\TestA\endcsname{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\@protected@testopt \TestB \\TestB {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@protected@testopt
+ \noexpand\TestB
+ \expandafter\noexpand\csname\string\TestB\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+ \GlobalLetLtxMacro\TestD\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestD}{\@protected@testopt \TestD \\TestD {\default }}%
\protected\edef\TestC{%
\noexpand\@protected@testopt
- \noexpand\TestB
- \expandafter\noexpand\csname\string\TestB\endcsname
+ \noexpand\TestD
+ \expandafter\noexpand\csname\string\TestD\endcsname
{\noexpand\default}%
}%
- \TestEquals{TestB}{TestC}%
- \CheckA
+ \TestEquals{TestD}{TestC}%
\end{qstest}
\begin{qstest}{newrobustcmd}{newrobustcmd}
- \newrobustcmd{\TestA}[1][\default]{TestA}%
- \SaveA
- \LetLtxMacro\TestB\TestA
- \TestDef{TestB}{\@testopt \\TestB {\default }}%
+ \begingroup
+ \newrobustcmd{\TestA}[1][\default]{TestA}%
+ \SaveA
+ \LetLtxMacro\TestB\TestA
+ \TestDef{TestB}{\@testopt \\TestB {\default }}%
+ \protected\edef\TestC{%
+ \noexpand\@testopt
+ \expandafter\noexpand\csname\string\TestB\endcsname
+ {\noexpand\default}%
+ }%
+ \TestEquals{TestB}{TestC}%
+ \CheckA
+ \GlobalLetLtxMacro\TestD\TestA
+ \CheckA
+ \endgroup
+ \TestDef{TestD}{\@testopt \\TestD {\default }}%
\protected\edef\TestC{%
\noexpand\@testopt
- \expandafter\noexpand\csname\string\TestB\endcsname
+ \expandafter\noexpand\csname\string\TestD\endcsname
{\noexpand\default}%
}%
- \TestEquals{TestB}{TestC}%
- \CheckA
+ \TestEquals{TestD}{TestC}%
\end{qstest}
\begin{qstest}{robustifyopt}{robustifyopt}