[latex3-commits] [git/LaTeX3-latex3-latex3] master: add test for keyval_parse:nnn (aa00c15d1)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Dec 31 12:05:47 CET 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/aa00c15d1133615e92247a71e73c0e4841d7e198
>---------------------------------------------------------------
commit aa00c15d1133615e92247a71e73c0e4841d7e198
Author: Jonathan Spratte <jspratte at yahoo.de>
Date: Sun Dec 20 13:04:38 2020 +0100
add test for keyval_parse:nnn
The existing tests for keyval_parse:NNn cover keyval_parse:nnn as well,
except for the case where more than one token has to be mapped, so this
just adds this one case as a simple test for keyval_parse:nnn.
>---------------------------------------------------------------
aa00c15d1133615e92247a71e73c0e4841d7e198
l3kernel/testfiles/m3keyval003.lvt | 41 ++++++++++++++++++++++
.../{m3regex010.luatex.tlg => m3keyval003.tlg} | 12 +++----
2 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/l3kernel/testfiles/m3keyval003.lvt b/l3kernel/testfiles/m3keyval003.lvt
new file mode 100644
index 000000000..590a59989
--- /dev/null
+++ b/l3kernel/testfiles/m3keyval003.lvt
@@ -0,0 +1,41 @@
+\documentclass{minimal}
+\input{regression-test}
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation , log-functions }
+\ExplSyntaxOff
+\begin{document}
+\START
+\AUTHOR{Jonathan P. Spratte}
+\ExplSyntaxOn
+
+\OMIT
+\cs_set:Npn \KV_check_key:nn #1#2
+ {
+ \str_if_eq:nnTF {#1} {#2} { 1 } { 0 }
+ .
+ }
+\cs_set:Npn \KV_check_key_val:nnnn #1#2#3#4
+ {
+ \str_if_eq:nnTF {#1} {#3} { 1 } { 0 }
+ \str_if_eq:nnTF {#2} {#4} { 1 } { 0 }
+ }
+\TIMO
+
+\TESTEXP{pass~ in~ several~ tokens}
+ {
+ \keyval_parse:nnn
+ { \KV_check_key:nn { key } }
+ { \KV_check_key_val:nnnn { key } { val } }
+ { k = v, k, key=val, key }
+ \NEWLINE
+ \use:e
+ {
+ \keyval_parse:nnn
+ { \KV_check_key:nn { key } }
+ { \KV_check_key_val:nnnn { key } { val } }
+ { k = v, k, key=val, key }
+ }
+ }
+
+\END
diff --git a/l3kernel/testfiles/m3regex010.luatex.tlg b/l3kernel/testfiles/m3keyval003.tlg
similarity index 59%
copy from l3kernel/testfiles/m3regex010.luatex.tlg
copy to l3kernel/testfiles/m3keyval003.tlg
index c0ad4d0c9..3b6df5e14 100644
--- a/l3kernel/testfiles/m3regex010.luatex.tlg
+++ b/l3kernel/testfiles/m3keyval003.tlg
@@ -1,13 +1,9 @@
This is a generated file for the LaTeX (2e + expl3) validation system.
Don't change this file in any respect.
-Author: Bruno Le Floch
+Author: Jonathan P. Spratte
============================================================
-TEST 1: LuaTeX bug which leads to an l3regex bug
+TEST 1: pass in several tokens
============================================================
-> Compiled regex {\\^^A}:
-+-branch
- char code 92
- char code 1.
-<recently read> }
-l. ... }
+\KV_check_key_val:nnnn {key}{val}{k}{v}\KV_check_key:nn {key}{k}\KV_check_key_val:nnnn {key}{val}{key}{val}\KV_check_key:nn {key}{key}
+000.111.
============================================================
More information about the latex3-commits
mailing list.