[latex3-commits] [git/LaTeX3-latex3-latex3] key-digest: More key tests (507f4628a)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Feb 28 13:39:03 CET 2022


Repository : https://github.com/latex3/latex3
On branch  : key-digest
Link       : https://github.com/latex3/latex3/commit/507f4628a7bb3140ddee650583ed19ec1d011b13

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

commit 507f4628a7bb3140ddee650583ed19ec1d011b13
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Feb 28 12:39:03 2022 +0000

    More key tests


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

507f4628a7bb3140ddee650583ed19ec1d011b13
 l3kernel/testfiles/m3keys008.lvt | 47 ++++++++++++++++++++++++++++++++++++++++
 l3kernel/testfiles/m3keys008.tlg | 17 +++++++++++++++
 2 files changed, 64 insertions(+)

diff --git a/l3kernel/testfiles/m3keys008.lvt b/l3kernel/testfiles/m3keys008.lvt
index 6b10296d5..dbf1684f9 100644
--- a/l3kernel/testfiles/m3keys008.lvt
+++ b/l3kernel/testfiles/m3keys008.lvt
@@ -53,4 +53,51 @@
     \tl_show:N \l_tmpa_tl
   }
 
+\TEST { Digesting~choices }
+  {
+    \OMIT
+      \keys_define:nn { test }
+        {
+          key-one .choice: ,
+          key-one / choice-one .code:n = AAAA ,
+          key-one / choice-two .code:n = BBBB ,
+          key-one / choice-three .code:n = CCCC ,
+          key-one / choice-four .code:n = DDDD ,
+          key-two .choice: ,
+          key-two / choice-one .code:n = AAAA ,
+          key-two / choice-two .code:n = BBBB ,
+          key-two / choice-three .code:n = CCCC ,
+          key-two / choice-four .code:n = DDDD ,
+          key-three .choices:nn =
+            { choice-one , choice-two , choice-three , choice-four }
+            {#1}
+        }
+    \TIMO
+    \keys_digest:nnN { test }
+      {
+        key-one = choice-one , key-one = choice-three ,
+        key-two = choice-one , key-two = choice-three ,
+        key-three = choice-one , key-three = choice-three
+      }
+      \l_tmpa_tl
+    \tl_show:N \l_tmpa_tl
+  }
+
+\TEST { Digesting~meta~keys }
+  {
+    \OMIT
+      \keys_define:nn { test }
+        {
+          key-one .code:n = #1 ,
+          key-two .meta:n = {key-one = "#1"}
+        }
+    \TIMO
+    \keys_digest:nnN { test }
+      {
+        key-one = AAA, key-two = BBB
+      }
+      \l_tmpa_tl
+    \tl_show:N \l_tmpa_tl
+  }
+
 \END
\ No newline at end of file
diff --git a/l3kernel/testfiles/m3keys008.tlg b/l3kernel/testfiles/m3keys008.tlg
index 5b691e730..7e5ca10e0 100644
--- a/l3kernel/testfiles/m3keys008.tlg
+++ b/l3kernel/testfiles/m3keys008.tlg
@@ -13,3 +13,20 @@ TEST 1: Key digestion of settings
 <recently read> }
 l. ...  }
 ============================================================
+============================================================
+TEST 2: Digesting choices
+============================================================
+> \l_tmpa_tl=AAAACCCCAAAACCCC\tl_set:Nn \l_keys_choice_tl
+{choice-one}\int_set:Nn \l_keys_choice_int {1}choice-one\tl_set:Nn
+\l_keys_choice_tl {choice-three}\int_set:Nn \l_keys_choice_int
+{3}choice-three.
+<recently read> }
+l. ...  }
+============================================================
+============================================================
+TEST 3: Digesting meta keys
+============================================================
+> \l_tmpa_tl=AAA"BBB".
+<recently read> }
+l. ...  }
+============================================================





More information about the latex3-commits mailing list.