[latex3-commits] [git/LaTeX3-latex3-latex3] gh900: Add testfiles and changelog for new map_tokens (fixes #900) (4c25e4016)

Bruno Le Floch blflatex at gmail.com
Wed May 5 00:47:23 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : gh900
Link       : https://github.com/latex3/latex3/commit/4c25e401609e94b352d430c7c920248be641ce2c

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

commit 4c25e401609e94b352d430c7c920248be641ce2c
Author: Bruno Le Floch <blflatex at gmail.com>
Date:   Wed May 5 00:47:07 2021 +0200

    Add testfiles and changelog for new map_tokens (fixes #900)


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

4c25e401609e94b352d430c7c920248be641ce2c
 l3kernel/CHANGELOG.md             |  2 ++
 l3kernel/testfiles/m3clist002.lvt |  6 +++++-
 l3kernel/testfiles/m3clist002.tlg | 11 ++++++++++-
 l3kernel/testfiles/m3str004.lvt   |  9 ++++++++-
 l3kernel/testfiles/m3str004.tlg   |  9 ++++++++-
 5 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 66550a2ac..241636b81 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -12,6 +12,8 @@ this project uses date-based 'snapshot' version identifiers.
 - `\ur{...}` escape in `l3regex` to compose regexes
 - `\seq_set_split_keep_spaces:Nnn` (see #784)
 - `\seq_set_item:Nnn(TF)` and `\seq_pop_item:NnN(TF)`
+- `\clist_map_tokens:nn`, `\clist_map_tokens:Nn`,
+  `\str_map_tokens:nn`, `\str_map_tokens:Nn`
 
 ### Changed
 - Use prevailing catcodes instead of string in regex replacement (issue #621)
diff --git a/l3kernel/testfiles/m3clist002.lvt b/l3kernel/testfiles/m3clist002.lvt
index 56f5c5e30..8392a7287 100644
--- a/l3kernel/testfiles/m3clist002.lvt
+++ b/l3kernel/testfiles/m3clist002.lvt
@@ -374,11 +374,15 @@
   \clist_map_inline:nn {aa,bb\par,cc} { \exp_args:No \TYPE {\tl_to_str:n{#1}} }
 }
 
-\TEST{map_function}{
+\TEST{map_function,map_tokens}{
   \cs_set:Npn \MAP:n #1 { \exp_args:No \TYPE {\tl_to_str:n{#1}} }
   \clist_map_function:NN \l_tmpa_clist  \MAP:n
   \clist_map_function:cN {l_tmpa_clist} \MAP:n
   \clist_map_function:nN {aa,bb\par,cc} \MAP:n
+  \cs_set:Npn \MAP:nn #1#2 { \exp_args:No \TYPE {\tl_to_str:n{#1:#2}} }
+  \clist_map_tokens:Nn \l_tmpa_clist  { \MAP:nn \A }
+  \clist_map_tokens:cn {l_tmpa_clist} { \MAP:nn \B }
+  \clist_map_tokens:nn {aa,bb\par,cc} { \MAP:n }
 }
 
 \TEST{map_variable}{
diff --git a/l3kernel/testfiles/m3clist002.tlg b/l3kernel/testfiles/m3clist002.tlg
index b98207c04..2c8bf5dac 100644
--- a/l3kernel/testfiles/m3clist002.tlg
+++ b/l3kernel/testfiles/m3clist002.tlg
@@ -287,7 +287,7 @@ bb\par
 cc
 ============================================================
 ============================================================
-TEST 24: map_function
+TEST 24: map_function,map_tokens
 ============================================================
 c
 b\par 
@@ -298,6 +298,15 @@ a
 aa
 bb\par 
 cc
+\A :c
+\A :b\par 
+\A :a
+\B :c
+\B :b\par 
+\B :a
+aa
+bb\par 
+cc
 ============================================================
 ============================================================
 TEST 25: map_variable
diff --git a/l3kernel/testfiles/m3str004.lvt b/l3kernel/testfiles/m3str004.lvt
index 56b9fb355..c3ea41123 100644
--- a/l3kernel/testfiles/m3str004.lvt
+++ b/l3kernel/testfiles/m3str004.lvt
@@ -21,7 +21,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \str_set:Nn \l_par_str { \par }
 \cs_set:Npn \test:n #1 { \token_to_meaning:N #1 }
-\TESTEXP { str_map_function }
+\TESTEXP { str_map_function , str_map_tokens }
   {
     | \str_map_function:nN { } \test:n | \NEWLINE
     | \str_map_function:nN { ~ } \test:n | \NEWLINE
@@ -29,6 +29,13 @@
     | \str_map_function:NN \c_empty_tl \test:n | \NEWLINE
     | \str_map_function:NN \c_space_tl \test:n | \NEWLINE
     | \str_map_function:NN \l_par_str \test:n | \NEWLINE
+    \SEPARATOR \NEWLINE
+    | \str_map_tokens:nn { } { ! \test:n } | \NEWLINE
+    | \str_map_tokens:nn { ~ } { ! \test:n } | \NEWLINE
+    | \str_map_tokens:nn { \par } { ! \test:n } | \NEWLINE
+    | \str_map_tokens:Nn \c_empty_tl { ! \test:n } | \NEWLINE
+    | \str_map_tokens:Nn \c_space_tl { ! \test:n } | \NEWLINE
+    | \str_map_tokens:Nn \l_par_str { ! \test:n } | \NEWLINE
   }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/l3kernel/testfiles/m3str004.tlg b/l3kernel/testfiles/m3str004.tlg
index c296f4bb2..141acdae7 100644
--- a/l3kernel/testfiles/m3str004.tlg
+++ b/l3kernel/testfiles/m3str004.tlg
@@ -2,7 +2,7 @@ This is a generated file for the LaTeX (2e + expl3) validation system.
 Don't change this file in any respect.
 Author: Bruno Le Floch
 ============================================================
-TEST 1: str_map_function
+TEST 1: str_map_function,str_map_tokens
 ============================================================
 ||
 |blank space  |
@@ -11,6 +11,13 @@ TEST 1: str_map_function
 |blank space  |
 |the character \the character pthe character athe character rblank space  |
 ============================================================
+||
+|!blank space  |
+|!the character \!the character p!the character a!the character r!blank space  |
+||
+|!blank space  |
+|!the character \!the character p!the character a!the character r!blank space  |
+============================================================
 ============================================================
 TEST 2: str_map_inline
 ============================================================





More information about the latex3-commits mailing list.