[latex3-commits] [git/LaTeX3-latex3-latex2e] gh239: Add tests for letting a control word to a control symbol... (073c6d70)

PhelypeOleinik tex.phelype at gmail.com
Sat May 9 05:34:03 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh239
Link       : https://github.com/latex3/latex2e/commit/073c6d70f9115505e4c916aebed26a19f1d2edfc

>---------------------------------------------------------------

commit 073c6d70f9115505e4c916aebed26a19f1d2edfc
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Sat May 9 00:34:03 2020 -0300

    Add tests for letting a control word to a control symbol...
    
    ...and the other way around.


>---------------------------------------------------------------

073c6d70f9115505e4c916aebed26a19f1d2edfc
 base/testfiles/github-0239.lvt | 34 +++++++++++++++++++++++++++++++++-
 base/testfiles/github-0239.tlg | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/base/testfiles/github-0239.lvt b/base/testfiles/github-0239.lvt
index 668c7d51..80c2cc38 100644
--- a/base/testfiles/github-0239.lvt
+++ b/base/testfiles/github-0239.lvt
@@ -44,10 +44,12 @@
   {\ifrobustcmd\letrobustcmd}
 %%
 
+\def\cmda{defined}
+
 % Here we need control words
 \def\test{\testt\tmp{tmp}}
 
-\test\cmda{\newcommand\cmda[1][]{boo}}
+\test\cmda{\renewcommand\cmda[1][]{boo}}
 
 \test\cmdb{\DeclareRobustCommand\cmdb[1]{boo}}
 
@@ -72,5 +74,35 @@
     \expandafter\noexpand\csname\string\%\endcsname{}}%
   \expandafter\def\csname\string\%\endcsname[#1]{boo}}
 
+
+
+% Test letting a control symbol to a control word
+\def\test{\testt\tmp{tmp}}
+
+\test\!{\renewcommand\![1][]{boo}}
+
+\test\#{\DeclareRobustCommand\#[1]{boo}}
+
+\test\${\DeclareRobustCommand\$[1][]{boo}}
+
+\test\%{%
+  \protected\edef\%{\noexpand\@testopt
+    \expandafter\noexpand\csname\string\%\endcsname{}}%
+  \expandafter\def\csname\string\%\endcsname[#1]{boo}}
+
+% And a control word to a control symbol
+\def\test{\testt\+{+}}
+
+\test\cmda{\renewcommand\cmda[1][]{boo}}
+
+\test\cmdb{\DeclareRobustCommand\cmdb[1]{boo}}
+
+\test\cmdc{\DeclareRobustCommand\cmdc[1][]{boo}}
+
+\test\cmdd{%
+  \protected\edef\cmdd{\noexpand\@testopt
+    \expandafter\noexpand\csname\string\cmdd\endcsname{}}%
+  \expandafter\def\csname\string\cmdd\endcsname[#1]{boo}}
+
 \end{document}
 
diff --git a/base/testfiles/github-0239.tlg b/base/testfiles/github-0239.tlg
index 3bd6de58..145f0eb9 100644
--- a/base/testfiles/github-0239.tlg
+++ b/base/testfiles/github-0239.tlg
@@ -34,4 +34,40 @@ LaTeX Info: Redefining \$ on input line ....
 \+ =\relax|
 \\+=macro:[#1]->boo|
 \\+ =\relax|
+\tmp=macro:->\@protected at testopt \tmp \\tmp {}|
+\tmp =\relax|
+\\tmp=\long macro:[#1]->boo|
+\\tmp =\relax|
+LaTeX Info: Redefining \# on input line ....
+\tmp=macro:->\protect \tmp  |
+\tmp =\long macro:#1->boo|
+\\tmp=\relax|
+\\tmp =\relax|
+LaTeX Info: Redefining \$ on input line ....
+\tmp=macro:->\protect \tmp  |
+\tmp =macro:->\@protected at testopt \tmp  \\tmp  {}|
+\\tmp=\relax|
+\\tmp =\long macro:[#1]->boo|
+\tmp=\protected macro:->\@testopt \\tmp |
+\tmp =\relax|
+\\tmp=macro:[#1]->boo|
+\\tmp =\relax|
+\+=macro:->\@protected at testopt \+\\+ {}|
+\+ =\relax|
+\\+=\long macro:[#1]->boo|
+\\+ =\relax|
+LaTeX Info: Redefining \cmdb on input line ....
+\+=macro:->\x at protect \+\protect \+  |
+\+ =\long macro:#1->boo|
+\\+=\relax|
+\\+ =\relax|
+LaTeX Info: Redefining \cmdc on input line ....
+\+=macro:->\x at protect \+\protect \+  |
+\+ =macro:->\@protected at testopt \+  \\+  {}|
+\\+=\relax|
+\\+ =\long macro:[#1]->boo|
+\+=\protected macro:->\@testopt \\+ |
+\+ =\relax|
+\\+=macro:[#1]->boo|
+\\+ =\relax|
 (github-0239.aux)





More information about the latex3-commits mailing list.