[latex3-commits] [git/LaTeX3-latex3-latex2e] TL21-2-kernel-msgs: add missing tests (625f0233)

Frank Mittelbach frank.mittelbach at latex-project.org
Sun Jun 6 22:02:44 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : TL21-2-kernel-msgs
Link       : https://github.com/latex3/latex2e/commit/625f0233bb725d281e15a640d0a9ab12ce565610

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

commit 625f0233bb725d281e15a640d0a9ab12ce565610
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sun Jun 6 22:02:44 2021 +0200

    add missing tests


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

625f0233bb725d281e15a640d0a9ab12ce565610
 base/ltcmd.dtx                           | 19 ++++++++----
 base/testfiles-ltcmd/ltcmd004.luatex.tlg | 42 +++++++++++++-------------
 base/testfiles-ltcmd/ltcmd004.tlg        | 42 +++++++++++++-------------
 base/testfiles-ltcmd/ltcmd007.lvt        | 35 +++++++++++++++++++++
 base/testfiles-ltcmd/ltcmd007.tlg        | 52 ++++++++++++++++++++++++++++++++
 base/update-ltcmd-tests.sh               |  3 +-
 6 files changed, 144 insertions(+), 49 deletions(-)

diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 8386c097..c8134303 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -3679,10 +3679,12 @@
     depend~on~each~other~in~a~way~that~cannot~be~resolved.
   }
 \msg_new:nnnn { cmd } { missing-required }
-  { Missing~required~argument~for~#1. }
+%  { Missing~required~argument~for~#1. }
+  { Required~argument~missing~for~#1. }
   {
-    The~current~#1~expects~an~argument~starting~with~'#2'.~
-    LaTeX~did~not~find~it,~and~will~insert~a~default~value~to~be~processed.
+    The~#1~expects~one~of~its~arguments~to~start~with~'#2'.~
+    LaTeX~did~not~find~this~argument~and~will~insert~a~default~value~
+    for~further~processing.
   }
 \msg_new:nnnn { cmd } { non-xparse }
   { \str_uppercase:n #1~not~defined~using~xparse. }
@@ -3750,9 +3752,14 @@
   }
 \msg_new:nnn { cmd } { optional-mandatory }
   {
-    Since~the~mandatory~argument~'#1'~has~the~same~delimiter~'#2'~
-    as~a~previous~optional~argument,~it~will~not~be~possible~to~
-    omit~all~optional~arguments~when~calling~this~command.
+    Optional~and~mandatory~argument~with~same~delimiter~'#2'.
+    \\ \\
+    The~mandatory~argument~specified~with~'r'~or~'R'~has~the~
+    same~delimiter~'#2'~as~an~earlier~optional~argument.~
+    It~will~therefore~not~be~possible~to~
+    omit~all~the~optional~arguments~when~calling~this~command.
+    \\ \\
+    This~may~be~intentional,~but~then~it~my~be~a~mistake.
   }
 \msg_new:nnn { cmd } { unsupported-let }
   {
diff --git a/base/testfiles-ltcmd/ltcmd004.luatex.tlg b/base/testfiles-ltcmd/ltcmd004.luatex.tlg
index 2747ee73..3f15978b 100644
--- a/base/testfiles-ltcmd/ltcmd004.luatex.tlg
+++ b/base/testfiles-ltcmd/ltcmd004.luatex.tlg
@@ -24,77 +24,77 @@ TEST 2: Basic definitions R-type arguments
 ============================================================
 TEST 3: r-type argument errors
 ============================================================
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (-NoValue-)(-NoValue-)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (nothing)(-NoValue-)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '['. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (stuff)(is)(-NoValue-)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+not find it and will insert a default value to be processed.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (-NoValue-)(-NoValue-)
 ============================================================
 ============================================================
 TEST 4: R-type argument errors
 ============================================================
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (-NoValue-)(drat)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (nothing)(drat)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '['. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (stuff)(is)(drat)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+not find it and will insert a default value to be processed.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (drat)(drat)
 ============================================================
 ============================================================
@@ -535,7 +535,7 @@ TEST 13: Test ## in expandable argument specification
 ============================================================
 ! Undefined control sequence.
 <argument> \::error 
-         ! cmd: Missing required argument for \foobar.
+         ! cmd: XMissing required argument for \foobar.
 l. ...  }
 The control sequence at the end of the top line
 of your error message was never \def'ed. If you have
diff --git a/base/testfiles-ltcmd/ltcmd004.tlg b/base/testfiles-ltcmd/ltcmd004.tlg
index 189130cc..05b8f372 100644
--- a/base/testfiles-ltcmd/ltcmd004.tlg
+++ b/base/testfiles-ltcmd/ltcmd004.tlg
@@ -24,77 +24,77 @@ TEST 2: Basic definitions R-type arguments
 ============================================================
 TEST 3: r-type argument errors
 ============================================================
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (-NoValue-)(-NoValue-)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (nothing)(-NoValue-)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '['. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (stuff)(is)(-NoValue-)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+not find it and will insert a default value to be processed.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (-NoValue-)(-NoValue-)
 ============================================================
 ============================================================
 TEST 4: R-type argument errors
 ============================================================
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (-NoValue-)(drat)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (nothing)(drat)(there)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '['. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (stuff)(is)(drat)
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
-! LaTeX cmd Error: Missing required argument for command '\foo'.
+not find it and will insert a default value to be processed.
+! LaTeX cmd Error: XMissing required argument for command '\foo'.
 For immediate help type H <return>.
  ...                                              
 l. ...  }
 The current command '\foo' expects an argument starting with '('. LaTeX did
-not find it, and will insert a default value to be processed.
+not find it and will insert a default value to be processed.
 (drat)(drat)
 ============================================================
 ============================================================
@@ -535,7 +535,7 @@ TEST 13: Test ## in expandable argument specification
 ============================================================
 ! Undefined control sequence.
 <argument> \::error 
-                    ! cmd: Missing required argument for \foobar.
+                    ! cmd: XMissing required argument for \foobar.
 l. ...  }
 The control sequence at the end of the top line
 of your error message was never \def'ed. If you have
diff --git a/base/testfiles-ltcmd/ltcmd007.lvt b/base/testfiles-ltcmd/ltcmd007.lvt
new file mode 100644
index 00000000..f27f8eda
--- /dev/null
+++ b/base/testfiles-ltcmd/ltcmd007.lvt
@@ -0,0 +1,35 @@
+
+\documentclass{minimal}
+\input{regression-test}
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation , log-functions }
+\ExplSyntaxOff
+
+\input xparse-generic.tex
+
+\START
+
+
+\ExplSyntaxOn
+
+\TEST { Missing~ required }
+  {
+    \NewDocumentCommand { \testA } { r<> } { }                \testA \relax
+    \NewDocumentCommand { \testB } { R(){?} R(){?} } { }      \testB (X) \relax
+    \RenewDocumentCommand { \testA } { +r<> } { }             \testA \relax
+    \RenewDocumentCommand { \testB } { R(){?} +R(){?} } { }   \testB (X) \relax
+  }
+
+\TEST { Optional~ +~ mandatory~ same~ delimiters }
+  {
+    \NewDocumentCommand{\foo}{osr[]}{\typeout{|#1|#2|#3|}}
+    \foo[A]
+    \foo*[B]
+    \foo[C][D]
+    \foo[E]*[G]
+  }
+
+
+\END
diff --git a/base/testfiles-ltcmd/ltcmd007.tlg b/base/testfiles-ltcmd/ltcmd007.tlg
new file mode 100644
index 00000000..21ccb9f9
--- /dev/null
+++ b/base/testfiles-ltcmd/ltcmd007.tlg
@@ -0,0 +1,52 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+============================================================
+TEST 1: Missing required
+============================================================
+! LaTeX cmd Error: Required argument missing for command '\testA'.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+The command '\testA' expects one of its arguments to start with '<'. LaTeX did
+not find this argument and will insert a default value for further processing.
+! LaTeX cmd Error: Required argument missing for command '\testB'.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+The command '\testB' expects one of its arguments to start with '('. LaTeX did
+not find this argument and will insert a default value for further processing.
+! LaTeX cmd Error: Required argument missing for command '\testA'.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+The command '\testA' expects one of its arguments to start with '<'. LaTeX did
+not find this argument and will insert a default value for further processing.
+! LaTeX cmd Error: Required argument missing for command '\testB'.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+The command '\testB' expects one of its arguments to start with '('. LaTeX did
+not find this argument and will insert a default value for further processing.
+============================================================
+============================================================
+TEST 2: Optional + mandatory same delimiters
+============================================================
+LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['
+(cmd)              
+(cmd)              The mandatory argument specified with 'r' or 'R' has the
+(cmd)              same delimiter '[' as an earlier optional argument. It will
+(cmd)              therefore not be possible to omit all the optional
+(cmd)              arguments when calling this command.
+(cmd)              
+(cmd)              This may be intentional, but then it my be a mistake.
+! LaTeX cmd Error: Required argument missing for command '\foo'.
+For immediate help type H <return>.
+ ...                                              
+l. ...  }
+The command '\foo' expects one of its arguments to start with '['. LaTeX did
+not find this argument and will insert a default value for further processing.
+|A|\BooleanFalse |-NoValue-|
+|-NoValue-|\BooleanTrue |B|
+|C|\BooleanFalse |D|
+|E|\BooleanTrue |G|
+============================================================
diff --git a/base/update-ltcmd-tests.sh b/base/update-ltcmd-tests.sh
index 91817c77..153ddae1 100644
--- a/base/update-ltcmd-tests.sh
+++ b/base/update-ltcmd-tests.sh
@@ -6,7 +6,8 @@ l3build save -cconfig-ltcmd \
    ltcmd003 \
    ltcmd004 \
    ltcmd005 \
-   ltcmd006 
+   ltcmd006 \
+   ltcmd007 
 
 l3build save -cconfig-ltcmd -eluatex \
    ltcmd002 \





More information about the latex3-commits mailing list.