[latex3-commits] [git/LaTeX3-latex3-latex3] cs-delimited-args: More tests for delimited arguments (daad5d4f2)

PhelypeOleinik tex.phelype at gmail.com
Fri Feb 28 17:02:13 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : cs-delimited-args
Link       : https://github.com/latex3/latex3/commit/daad5d4f2622de078a7ef6f20c901fd33d7d54f1

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

commit daad5d4f2622de078a7ef6f20c901fd33d7d54f1
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Fri Feb 28 13:02:13 2020 -0300

    More tests for delimited arguments


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

daad5d4f2622de078a7ef6f20c901fd33d7d54f1
 l3packages/xparse/testfiles/xparse004.luatex.tlg | 40 +++++++++++++++++++++---
 l3packages/xparse/testfiles/xparse004.lvt        | 36 ++++++++++++++++++++-
 l3packages/xparse/testfiles/xparse004.tlg        | 40 +++++++++++++++++++++---
 3 files changed, 105 insertions(+), 11 deletions(-)

diff --git a/l3packages/xparse/testfiles/xparse004.luatex.tlg b/l3packages/xparse/testfiles/xparse004.luatex.tlg
index 22b418211..aef9985d3 100644
--- a/l3packages/xparse/testfiles/xparse004.luatex.tlg
+++ b/l3packages/xparse/testfiles/xparse004.luatex.tlg
@@ -859,7 +859,7 @@ abc/-NoValue-
 -NoValue-/something
 ============================================================
 ============================================================
-TEST 29: More non-character token delimiters
+TEST 29: Non-character delimiters: delimiters with the same definition
 ============================================================
 (abc)
 (-NoValue-)
@@ -867,9 +867,39 @@ Removed: (\)abc\))
 (abc)
 (-NoValue-)
 Removed: (abc\){})
+(\BooleanTrue )
+(\BooleanFalse )
+(l|-NoValue-)
+(-NoValue-|r)
+(l|-NoValue-)
+Removed: (\({l})
+(-NoValue-|r)
+Removed: (\){r})
+(l|r)
+(l|r)
 ============================================================
 ============================================================
-TEST 30: Non-character delimiters: forbidden delimiters
+TEST 30: Non-character delimiters: delimiters \let to the same token
+============================================================
+(abc)
+(-NoValue-)
+Removed: (\)abc\))
+(abc)
+(-NoValue-)
+Removed: (abc\){})
+(\BooleanTrue )
+(\BooleanFalse )
+(l|-NoValue-)
+(-NoValue-|r)
+(l|-NoValue-)
+Removed: (\({l})
+(-NoValue-|r)
+Removed: (\){r})
+(l|r)
+(l|r)
+============================================================
+============================================================
+TEST 31: Non-character delimiters: forbidden delimiters
 ============================================================
 ! LaTeX3 Error: Argument delimiter '\(' for the command '\foo' is not allowed.
 For immediate help type H <return>.
@@ -926,7 +956,7 @@ LaTeX will ignore this entire definition.
 (abc)
 ============================================================
 ============================================================
-TEST 31: IfBoolean multi token
+TEST 32: IfBoolean multi token
 ============================================================
 ! Undefined control sequence.
 <argument> \LaTeX3 error: 
@@ -959,13 +989,13 @@ and I'll forget about whatever was undefined.
 FALSE
 ============================================================
 ============================================================
-TEST 32: Processor spaces
+TEST 33: Processor spaces
 ============================================================
 |{a}{bcd}|
 > \box_wd:N \l_tmpa_box =0.0pt.
 ============================================================
 ============================================================
-TEST 33: Processor depending on other argument
+TEST 34: Processor depending on other argument
 ============================================================
 |{a}{bcd;e}|1|
 |{a,bcd}{e}|1|
diff --git a/l3packages/xparse/testfiles/xparse004.lvt b/l3packages/xparse/testfiles/xparse004.lvt
index 05406af0b..b1a603046 100644
--- a/l3packages/xparse/testfiles/xparse004.lvt
+++ b/l3packages/xparse/testfiles/xparse004.lvt
@@ -467,7 +467,7 @@
     \foo \undefinedSecondArgument {something}
   }
 
-\TEST { More~non-character~token~delimiters }
+\TEST { Non-character~delimiters:~delimiters~with~the~same~definition }
   {
     \cs_set:Npn \( {abc}
     \cs_set:Npn \) {abc}
@@ -479,6 +479,40 @@
     \DeclareExpandableDocumentCommand { \foo } { d\(\) m } { \TYPE { (#1) } \clean }
     \foo\(abc\){}\z
     \foo\)abc\){}\z
+    \DeclareDocumentCommand { \foo } { t\( } { \TYPE { (#1) } }
+    \foo\(
+    \foo\)
+    \DeclareDocumentCommand { \foo } { e{\(\)} } { \TYPE { (#1|#2) } \clean }
+    \foo\({l}\z
+    \foo\){r}\z
+    \foo\({l}\({l}\z
+    \foo\){r}\){r}\z
+    \foo\({l}\){r}\z
+    \foo\){r}\({l}\z
+  }
+
+\TEST { Non-character~delimiters:~delimiters~\let~to~the~same~token }
+  {
+    \cs_set_eq:NN \( ?
+    \cs_set_eq:NN \) ?
+    \cs_set:Npn \clean #1 \z
+      { \tl_if_empty:nF {#1} { \TYPE { Removed:~( \exp_not:n {#1} ) } } }
+    \DeclareDocumentCommand { \foo } { d\(\) } { \TYPE { (#1) } \clean }
+    \foo\(abc\)\z
+    \foo\)abc\)\z
+    \DeclareExpandableDocumentCommand { \foo } { d\(\) m } { \TYPE { (#1) } \clean }
+    \foo\(abc\){}\z
+    \foo\)abc\){}\z
+    \DeclareDocumentCommand { \foo } { t\( } { \TYPE { (#1) } }
+    \foo\(
+    \foo\)
+    \DeclareDocumentCommand { \foo } { e{\(\)} } { \TYPE { (#1|#2) } \clean }
+    \foo\({l}\z
+    \foo\){r}\z
+    \foo\({l}\({l}\z
+    \foo\){r}\){r}\z
+    \foo\({l}\){r}\z
+    \foo\){r}\({l}\z
   }
 
 \TEST { Non-character~delimiters:~forbidden~delimiters }
diff --git a/l3packages/xparse/testfiles/xparse004.tlg b/l3packages/xparse/testfiles/xparse004.tlg
index 69529e2b4..1ef8db0aa 100644
--- a/l3packages/xparse/testfiles/xparse004.tlg
+++ b/l3packages/xparse/testfiles/xparse004.tlg
@@ -859,7 +859,7 @@ abc/-NoValue-
 -NoValue-/something
 ============================================================
 ============================================================
-TEST 29: More non-character token delimiters
+TEST 29: Non-character delimiters: delimiters with the same definition
 ============================================================
 (abc)
 (-NoValue-)
@@ -867,9 +867,39 @@ Removed: (\)abc\))
 (abc)
 (-NoValue-)
 Removed: (abc\){})
+(\BooleanTrue )
+(\BooleanFalse )
+(l|-NoValue-)
+(-NoValue-|r)
+(l|-NoValue-)
+Removed: (\({l})
+(-NoValue-|r)
+Removed: (\){r})
+(l|r)
+(l|r)
 ============================================================
 ============================================================
-TEST 30: Non-character delimiters: forbidden delimiters
+TEST 30: Non-character delimiters: delimiters \let to the same token
+============================================================
+(abc)
+(-NoValue-)
+Removed: (\)abc\))
+(abc)
+(-NoValue-)
+Removed: (abc\){})
+(\BooleanTrue )
+(\BooleanFalse )
+(l|-NoValue-)
+(-NoValue-|r)
+(l|-NoValue-)
+Removed: (\({l})
+(-NoValue-|r)
+Removed: (\){r})
+(l|r)
+(l|r)
+============================================================
+============================================================
+TEST 31: Non-character delimiters: forbidden delimiters
 ============================================================
 ! LaTeX3 Error: Argument delimiter '\(' for the command '\foo' is not allowed.
 For immediate help type H <return>.
@@ -926,7 +956,7 @@ LaTeX will ignore this entire definition.
 (abc)
 ============================================================
 ============================================================
-TEST 31: IfBoolean multi token
+TEST 32: IfBoolean multi token
 ============================================================
 ! Undefined control sequence.
 <argument> \LaTeX3 error: 
@@ -959,13 +989,13 @@ and I'll forget about whatever was undefined.
 FALSE
 ============================================================
 ============================================================
-TEST 32: Processor spaces
+TEST 33: Processor spaces
 ============================================================
 |{a}{bcd}|
 > \box_wd:N \l_tmpa_box =0.0pt.
 ============================================================
 ============================================================
-TEST 33: Processor depending on other argument
+TEST 34: Processor depending on other argument
 ============================================================
 |{a}{bcd;e}|1|
 |{a,bcd}{e}|1|





More information about the latex3-commits mailing list.