[latex3-commits] [latex3/latex3] develop: More \seq_map_break:(n) tests (2ddc28442)

github at latex-project.org github at latex-project.org
Mon Sep 2 17:46:03 CEST 2024


Repository : https://github.com/latex3/latex3
On branch  : develop
Link       : https://github.com/latex3/latex3/commit/2ddc284421b5c6decddb84c357ad6f0e2d28f76a

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

commit 2ddc284421b5c6decddb84c357ad6f0e2d28f76a
Author: Yukai Chou <muzimuzhi at gmail.com>
Date:   Mon Sep 2 23:07:36 2024 +0800

    More \seq_map_break:(n) tests


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

2ddc284421b5c6decddb84c357ad6f0e2d28f76a
 l3kernel/testfiles/m3seq008.lvt | 59 +++++++++++++++++++++++++++++++++++++++++
 l3kernel/testfiles/m3seq008.tlg | 55 +++++++++++++++++++++++++++++++++++---
 2 files changed, 111 insertions(+), 3 deletions(-)

diff --git a/l3kernel/testfiles/m3seq008.lvt b/l3kernel/testfiles/m3seq008.lvt
index b6f8ecd9d..81403addd 100644
--- a/l3kernel/testfiles/m3seq008.lvt
+++ b/l3kernel/testfiles/m3seq008.lvt
@@ -39,6 +39,8 @@
   \cs_set:Npn \test:nn #1#2 { \TYPE { \tl_to_str:n {"#1":"#2"} } \NEWLINE }
   \cs_set:Npn \test_break:nn #1#2
     { \test:nn {#1} {#2} \seq_map_break: }
+  \cs_set:Npn \test_break_n:nn #1#2
+    { \test:nn {#1} {#2} \seq_map_break:n { \TYPE {broken} } }
 \TIMO
 
 \TESTEXP { seq_map_pairwise_function:NNN }
@@ -56,6 +58,21 @@
     \seq_map_pairwise_function:NNN \l_tmpb_seq \g_tmpb_seq \test:nn
   }
 
+\TESTEXP { seq_map_break:~in~seq_map_pairwise_function:NNN }
+  {
+    \seq_map_pairwise_function:NNN \l_tmpa_seq \l_tmpb_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_pairwise_function:NNN \l_tmpb_seq \l_tmpa_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_pairwise_function:NNN \g_tmpa_seq \l_tmpb_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_pairwise_function:NNN \l_tmpb_seq \g_tmpa_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_pairwise_function:NNN \g_tmpb_seq \l_tmpb_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_pairwise_function:NNN \l_tmpb_seq \g_tmpb_seq \test_break:nn
+  }
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \TESTEXP { seq_map_indexed_function:NN }
@@ -69,6 +86,17 @@
     \seq_map_indexed_function:NN \g_tmpb_seq \test:nn
   }
 
+\TESTEXP { seq_map_indexed_function:NN ~ with ~ seq_map_break: }
+  {
+    \seq_map_indexed_function:NN \l_tmpa_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_indexed_function:NN \l_tmpb_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_indexed_function:NN \g_tmpa_seq \test_break:nn
+    \SEPARATOR \NEWLINE
+    \seq_map_indexed_function:NN \g_tmpb_seq \test_break:nn
+  }
+
 \TEST { seq_map_indexed_inline:Nn }
   {
     \seq_map_indexed_inline:Nn \l_tmpa_seq { \TYPE { \tl_to_str:n { "#1":"#2" } } }
@@ -80,6 +108,26 @@
     \seq_map_indexed_inline:Nn \g_tmpb_seq { \TYPE { \tl_to_str:n { "#1":"#2" } } }
   }
 
+\OMIT
+\cs_new_protected:Npn \test_break_n:
+  { \seq_map_break:n { \TYPE {broken} } }
+\TIMO
+
+\TEST { seq_map_indexed_inline:Nn ~ with ~ seq_map_break:n }
+  {
+    \seq_map_indexed_inline:Nn \l_tmpa_seq
+      { \TYPE { \tl_to_str:n { "#1":"#2" } } \test_break_n: }
+    \SEPARATOR
+    \seq_map_indexed_inline:Nn \l_tmpb_seq
+      { \TYPE { \tl_to_str:n { "#1":"#2" } } \test_break_n: }
+    \SEPARATOR
+    \seq_map_indexed_inline:Nn \g_tmpa_seq
+      { \TYPE { \tl_to_str:n { "#1":"#2" } } \test_break_n: }
+    \SEPARATOR
+    \seq_map_indexed_inline:Nn \g_tmpb_seq
+      { \TYPE { \tl_to_str:n { "#1":"#2" } } \test_break_n: }
+  }
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 % \prg_break_point: is just there to check the user code is wrapped in \use:n or similar
@@ -94,6 +142,17 @@
     \seq_map_tokens:Nn \g_tmpb_seq { \test:nn { A } }
   }
 
+\TEST { seq_map_tokens:Nn ~ with ~ seq_map_break:n }
+  {
+    \seq_map_tokens:Nn \l_tmpa_seq { \test_break_n:nn { A } }
+    \SEPARATOR
+    \seq_map_tokens:Nn \l_tmpb_seq { \test_break_n:nn { A } }
+    \SEPARATOR
+    \seq_map_tokens:Nn \g_tmpa_seq { \test_break_n:nn { A } }
+    \SEPARATOR
+    \seq_map_tokens:Nn \g_tmpb_seq { \test_break_n:nn { A } }
+  }
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 \END
diff --git a/l3kernel/testfiles/m3seq008.tlg b/l3kernel/testfiles/m3seq008.tlg
index 8722736cd..2b33c89c5 100644
--- a/l3kernel/testfiles/m3seq008.tlg
+++ b/l3kernel/testfiles/m3seq008.tlg
@@ -23,7 +23,20 @@ TEST 1: seq_map_pairwise_function:NNN
 ============================================================
 ============================================================
 ============================================================
-TEST 2: seq_map_indexed_function:NN
+TEST 2: seq_map_break: in seq_map_pairwise_function:NNN
+============================================================
+"c":"{C}"
+============================================================
+"{C}":"c"
+============================================================
+"\f ":"{C}"
+============================================================
+"{C}":"\f "
+============================================================
+============================================================
+============================================================
+============================================================
+TEST 3: seq_map_indexed_function:NN
 ============================================================
 "1":"c"
 "2":"b"
@@ -42,7 +55,17 @@ TEST 2: seq_map_indexed_function:NN
 ============================================================
 ============================================================
 ============================================================
-TEST 3: seq_map_indexed_inline:Nn
+TEST 4: seq_map_indexed_function:NN with seq_map_break:
+============================================================
+"1":"c"
+============================================================
+"1":"{C}"
+============================================================
+"1":"\f "
+============================================================
+============================================================
+============================================================
+TEST 5: seq_map_indexed_inline:Nn
 ============================================================
 "1":"c"
 "2":"b"
@@ -61,7 +84,20 @@ TEST 3: seq_map_indexed_inline:Nn
 ============================================================
 ============================================================
 ============================================================
-TEST 4: seq_map_tokens:Nn
+TEST 6: seq_map_indexed_inline:Nn with seq_map_break:n
+============================================================
+"1":"c"
+broken
+============================================================
+"1":"{C}"
+broken
+============================================================
+"1":"\f "
+broken
+============================================================
+============================================================
+============================================================
+TEST 7: seq_map_tokens:Nn
 ============================================================
 "A":"c"
 "A":"b"
@@ -79,3 +115,16 @@ TEST 4: seq_map_tokens:Nn
 "A":"\a "
 ============================================================
 ============================================================
+============================================================
+TEST 8: seq_map_tokens:Nn with seq_map_break:n
+============================================================
+"A":"c"
+broken
+============================================================
+"A":"{C}"
+broken
+============================================================
+"A":"\f "
+broken
+============================================================
+============================================================





More information about the latex3-commits mailing list.