1 \documentclass{article}
10 \AUTHOR{David Carlisle}
14 \define@key{test}{foo}{\toks@{#1}\typeout{foo=(\the\toks@)}}
15 \define@key{test}{b}[zzz]{\toks@{#1}\typeout{b=(\the\toks@)}}
19 % exactly one set of braces should be stripped (original implementation stripped 2)
20 % revert this change in v1.15
21 \setkeys{test}{foo=a,b}
22 \setkeys{test}{foo={a,b}}
23 \setkeys{test}{foo={{a,b}}}
24 \setkeys{test}{foo={{{a,b}}}}
26 % space trimmed from value
28 \setkeys{test}{foo= a}
29 \setkeys{test}{foo =a}
30 \setkeys{test}{foo = a}
31 \setkeys{test}{foo=a }
32 \setkeys{test}{foo= a }
33 \setkeys{test}{foo =a }
34 \setkeys{test}{foo = a }
36 % allow \par in values
37 \setkeys{test}{ foo=x \par y }
40 % additional tests to test brace stripping and space around =
41 % preserve the original inconsistent behaviour of dropping 1 or 2
44 \define@key{zz}{inherit}{\toks0{#1}\typeout{[\the\toks0]}}
49 \typeout{^^J1a Should be [\string\j\space erman]}
50 \setkeys{zz}{inherit={\j erman}}
51 \setkeys{zz}{inherit ={\j erman}}
52 \typeout{1b Should be [\string\j\space erman]}
53 \setkeys{zz}{inherit= {\j erman}}
54 \setkeys{zz}{inherit = {\j erman}}
56 \typeout{^^J2a Should be [german]}
57 \setkeys{zz}{inherit={german}}
58 \setkeys{zz}{inherit ={german}}
59 \typeout{2b Should be [german]}
60 \setkeys{zz}{inherit= {german}}
61 \setkeys{zz}{inherit = {german}}
64 \typeout{^^J3a Should be [\string\j\space erman]}
65 \setkeys{zz}{inherit=\j erman}
66 \setkeys{zz}{inherit =\j erman}
67 \typeout{3b Should be [\string\j\space erman]}
68 \setkeys{zz}{inherit= \j erman}
69 \setkeys{zz}{inherit = \j erman}
71 \typeout{^^J4a Should be [german]}
72 \setkeys{zz}{inherit=german}
73 \setkeys{zz}{inherit =german}
74 \typeout{^^J4b Should be [german]}
75 \setkeys{zz}{inherit= german}
76 \setkeys{zz}{inherit = german}
78 \typeout{^^J5a Should be [german]}
79 \setkeys{zz}{inherit={{german}}}
80 \setkeys{zz}{inherit ={{german}}}
81 \typeout{5b Should be [{german}]}
82 \setkeys{zz}{inherit= {{german}}}
83 \setkeys{zz}{inherit = {{german}}}
85 \typeout{^^J6a Should be [{german}]}
86 \setkeys{zz}{inherit={{{german}}}}
87 \setkeys{zz}{inherit ={{{german}}}}
88 \typeout{6b Should be [{{german}}]}
89 \setkeys{zz}{inherit= {{{german}}}}
90 \setkeys{zz}{inherit = {{{german}}}}