[latex3-commits] [git/LaTeX3-latex3-latex2e] keyval-detect: Add tests (d0d22fda)

PhelypeOleinik phelype.oleinik at latex-project.org
Tue Aug 30 04:19:15 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : keyval-detect
Link       : https://github.com/latex3/latex2e/commit/d0d22fdabf4120e0b3a40020338f4bc923e7b5ce

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

commit d0d22fdabf4120e0b3a40020338f4bc923e7b5ce
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon Aug 29 23:19:15 2022 -0300

    Add tests


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

d0d22fdabf4120e0b3a40020338f4bc923e7b5ce
 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.