[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Add tests (bec1f1ec)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Sep 1 22:17:07 CEST 2022
Repository : https://github.com/latex3/latex2e
On branch : develop
Link : https://github.com/latex3/latex2e/commit/bec1f1ec21fd293bbe22a9b3aa740542956c364d
>---------------------------------------------------------------
commit bec1f1ec21fd293bbe22a9b3aa740542956c364d
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Mon Aug 29 23:19:15 2022 -0300
Add tests
>---------------------------------------------------------------
bec1f1ec21fd293bbe22a9b3aa740542956c364d
base/testfiles-ltcmd/ltcmd008.lvt | 13 +++++++++++++
base/testfiles-ltcmd/ltcmd008.tlg | 28 ++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/base/testfiles-ltcmd/ltcmd008.lvt b/base/testfiles-ltcmd/ltcmd008.lvt
index f703d6c6..01b3cb4d 100644
--- a/base/testfiles-ltcmd/ltcmd008.lvt
+++ b/base/testfiles-ltcmd/ltcmd008.lvt
@@ -50,4 +50,17 @@
{ \foo [ [ baz ] ] }
}
+\TEST { Using~={...}~with~\ShowCommand and~\NewCommandCopy }
+ {
+ \DeclareDocumentCommand \foo { = { TOC-entry } O{#2} m } { \TYPE { \detokenize { (#1) (#2) } } }
+ \ShowCommand\foo
+ \DeclareCommandCopy\bar\foo
+ \ShowCommand\bar
+ }
+
+\TEST { Trying~to~define~expandable~with~={...} }
+ {
+ \DeclareExpandableDocumentCommand \foo { = { TOC-entry } O{#2} m } { }
+ }
+
\END
diff --git a/base/testfiles-ltcmd/ltcmd008.tlg b/base/testfiles-ltcmd/ltcmd008.tlg
index 1d154a02..e74b0f31 100644
--- a/base/testfiles-ltcmd/ltcmd008.tlg
+++ b/base/testfiles-ltcmd/ltcmd008.tlg
@@ -31,3 +31,31 @@ TEST 4: Awkward catcodes
(TOC-entry={baz})
(TOC-entry={baz})
============================================================
+============================================================
+TEST 5: Using ={...} with \ShowCommand and \NewCommandCopy
+============================================================
+> \foo=document command:
+ #1:={TOC-entry}O{##2}
+ #2:m
+->\TYPE {\detokenize {(#1)(#2)}}.
+<recently read> }
+l. ... }
+> \bar=document command:
+ #1:={TOC-entry}O{##2}
+ #2:m
+->\TYPE {\detokenize {(#1)(#2)}}.
+<recently read> }
+l. ... }
+============================================================
+============================================================
+TEST 6: Trying to define expandable with ={...}
+============================================================
+! LaTeX cmd Error: Invalid argument prefix '=' in command '\foo'.
+For immediate help type H <return>.
+ ...
+l. ... }
+The argument specification for '\foo' contains a key--value marker
+'={TOC-entry}'. This is only supported for robust commands, but not for
+expandable ones.
+LaTeX will ignore this entire definition.
+============================================================
More information about the latex3-commits
mailing list.