[latex3-commits] [latex3/latex2e] develop: Add test for #1523 (9c06f5eee)

github at latex-project.org github at latex-project.org
Mon Nov 4 14:01:05 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/9c06f5eee9c2fec3d4e4addbfc7f38573a52ab52

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

commit 9c06f5eee9c2fec3d4e4addbfc7f38573a52ab52
Author: Joseph Wright <joseph at texdev.net>
Date:   Mon Nov 4 12:58:08 2024 +0000

    Add test for #1523


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

9c06f5eee9c2fec3d4e4addbfc7f38573a52ab52
 base/testfiles-lttemplates/lttemplates005.lvt | 74 +++++++++++++++++++++++++++
 base/testfiles-lttemplates/lttemplates005.tlg |  4 ++
 2 files changed, 78 insertions(+)

diff --git a/base/testfiles-lttemplates/lttemplates005.lvt b/base/testfiles-lttemplates/lttemplates005.lvt
index ee85f8a95..88c0e2522 100644
--- a/base/testfiles-lttemplates/lttemplates005.lvt
+++ b/base/testfiles-lttemplates/lttemplates005.lvt
@@ -99,4 +99,78 @@
     \UseInstance { test } { runaway }
   }
 
+\OMIT
+
+  \dim_new:N \dimcode
+  \fp_new:N \fpcode
+  \int_new:N \intcode
+  \muskip_new:N \muskipcode
+  \skip_new:N \skipcode
+  \tl_new:N \tlcode
+  \DeclareTemplateInterface { test } { std4 } { 0 }
+    {
+      dim.code : length ,
+      code.dim : length = \KeyValue { dim.code } ,
+      fp.code : real ,
+      code.fp : real = \KeyValue { fp.code } ,
+      int.code : integer ,
+      code.int : integer = \KeyValue { int.code } ,
+      muskip.code : muskip ,
+      code.muskip : muskip = \KeyValue { muskip.code } ,
+      skip.code : skip ,
+      code.skip : skip = \KeyValue { skip.code } ,
+      tokenlist.code : tokenlist ,
+      code.tokenlist : tokenlist = \KeyValue { tokenlist.code }
+    }
+  \DeclareTemplateCode { test } { std4 } { 0 }
+    {
+      dim.code = \dimcode ,
+      code.dim = \dimcode ,
+      fp.code = \fpcode ,
+      code.fp = \fpcode ,
+      int.code = \intcode ,
+      code.int = \intcode ,
+      muskip.code = \muskipcode ,
+      code.muskip = \muskipcode ,
+      skip.code = \skipcode ,
+      code.skip = \skipcode ,
+      tokenlist.code = \tlcode ,
+      code.tokenlist = \tlcode
+    }
+    {
+      \AssignTemplateKeys
+      ( \dimeval { \dimcode } )
+      ( \fpeval { \fpcode } )
+      ( \inteval { \intcode } )
+      ( \the \muexpr \muskipcode \relax )
+      ( \the \glueexpr \skipcode \relax )
+      ( \tlcode )
+    }
+
+\TIMO
+
+\TEST { Key-value~passing }
+  {
+    \DeclareInstance{ test } { i1 } { std4 }
+      {
+        dim.code = 1pt ,
+        fp.code = 1 ,
+        int.code = 1 ,
+        muskip.code = 1mu ,
+        skip.code = 1pt ,
+        tokenlist.code = AAA
+      }
+    \DeclareInstance{ test } { i2 } { std4 }
+      {
+        code.dim = 1pt ,
+        code.fp = 1 ,
+        code.int = 1 ,
+        code.muskip = 1mu ,
+        code.skip = 1pt ,
+        code.tokenlist = AAA
+      }
+    \UseInstance { test } { i1 }
+    \UseInstance { test } { i2 }
+  }
+
 \END
diff --git a/base/testfiles-lttemplates/lttemplates005.tlg b/base/testfiles-lttemplates/lttemplates005.tlg
index 7b5478e4c..0b58b3ef4 100644
--- a/base/testfiles-lttemplates/lttemplates005.tlg
+++ b/base/testfiles-lttemplates/lttemplates005.tlg
@@ -24,3 +24,7 @@ TEST 3: Key values for booleans
 true
 true
 ============================================================
+============================================================
+TEST 4: Key-value passing
+============================================================
+============================================================





More information about the latex3-commits mailing list.