Skip to content

Commit

Permalink
Add test for latex3#1523
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Nov 4, 2024
1 parent ddbe158 commit 9c06f5e
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
74 changes: 74 additions & 0 deletions base/testfiles-lttemplates/lttemplates005.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions base/testfiles-lttemplates/lttemplates005.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ TEST 3: Key values for booleans
true
true
============================================================
============================================================
TEST 4: Key-value passing
============================================================
============================================================

0 comments on commit 9c06f5e

Please sign in to comment.