[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Add test files for quarks in clists (414da1eb3)

PhelypeOleinik tex.phelype at gmail.com
Mon Mar 30 14:34:42 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : scan-quark
Link       : https://github.com/latex3/latex3/commit/414da1eb3fb3f8a695a9c30366b7f315ae623bee

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

commit 414da1eb3fb3f8a695a9c30366b7f315ae623bee
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Mon Mar 30 09:34:42 2020 -0300

    Add test files for quarks in clists


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

414da1eb3fb3f8a695a9c30366b7f315ae623bee
 l3kernel/testfiles/m3clist007.lvt                  | 81 ++++++++++++++++++++++
 .../testfiles/m3clist007.tlg                       | 68 +++++++++++-------
 2 files changed, 123 insertions(+), 26 deletions(-)

diff --git a/l3kernel/testfiles/m3clist007.lvt b/l3kernel/testfiles/m3clist007.lvt
new file mode 100644
index 000000000..758542b1b
--- /dev/null
+++ b/l3kernel/testfiles/m3clist007.lvt
@@ -0,0 +1,81 @@
+%
+% Copyright (C) 2020 The LaTeX Project
+%
+\documentclass{minimal}
+\input{regression-test}
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation , log-functions }
+\ExplSyntaxOff
+
+\begin{document}
+\AUTHOR{Phelype Oleinik}
+\ExplSyntaxOn
+
+\clist_new:N \l_test_clist
+\tl_new:N \l_test_tl
+\cs_new:Npn \test_function:n #1 { \TYPE { \tl_to_str:n {#1} } }
+
+% These tests ensure that public quarks can be used in clists.
+% Initially reported: https://tex.stackexchange.com/a/496786/134574
+% Implemented in PR: https://github.com/latex3/latex3/pull/690
+
+\START
+
+\TEST { \q_mark and~\clist_reverse:N }
+  {
+    % Previous behaviour: infinite expansion of \q_mark
+    \clist_set:Nn \l_test_clist { a, \q_mark, b }
+    \clist_reverse:N \l_test_clist
+    \clist_show:N \l_test_clist
+  }
+
+\TEST { \q_stop and~\clist_get:NN }
+  {
+    % Previous behaviour: ! Missing control sequence inserted.
+    \clist_set:Nn \l_test_clist { a, \q_stop, b }
+    \clist_get:NN \l_test_clist \l_test_tl
+    \clist_show:N \l_test_tl
+    \tl_show:N \l_test_tl
+  }
+
+\TEST { \q_stop and~\clist_pop:NN }
+  {
+    % Previous behaviour: ! Missing control sequence inserted.
+    \clist_set:Nn \l_test_clist { a, \q_stop, b }
+    \clist_pop:NN \l_test_clist \l_test_tl
+    \clist_show:N \l_test_tl
+    \tl_show:N \l_test_tl
+  }
+
+\TEST { \q_stop and~\clist_item:Nn }
+  {
+    % Previous behaviour: infinite expansion of \q_stop
+    \clist_set:Nn \l_test_clist { a, \q_stop, b }
+    \tl_set:Nx \l_test_tl { \clist_item:Nn \l_test_clist { 1 } }
+    \tl_show:N \l_test_tl
+  }
+
+\TEST { \q_recursion_tail and~\clist_map_function:NN }
+  {
+    % Previous behaviour: recursion would end prematurely at \q_recursion_tail
+    \clist_set:Nn \l_test_clist { a, \q_recursion_tail, b }
+    \clist_map_function:NN \l_test_clist \test_function:n
+  }
+
+\TEST { \q_recursion_tail with~\q_recursion_stop and~\clist_map_function:NN }
+  {
+    % Previous behaviour: same as above, plus infinite expansion of \q_recursion_tail
+    \clist_set:Nn \l_test_clist { a, \q_recursion_tail, b, \q_recursion_stop, c }
+    \clist_map_function:NN \l_test_clist \test_function:n
+  }
+
+\TEST { \q_nil and~\clist_set:Nn }
+  {
+    % Previous behaviour: the clist item would be trincated at the \q_nil
+    \clist_set:Nn \l_test_clist { u \q_nil v }
+    \clist_show:N \l_test_clist
+  }
+
+\END
diff --git a/l3trial/l3htoks/testfiles/m3htoks001.tlg b/l3kernel/testfiles/m3clist007.tlg
similarity index 61%
copy from l3trial/l3htoks/testfiles/m3htoks001.tlg
copy to l3kernel/testfiles/m3clist007.tlg
index 79eba075a..677f1d8dd 100644
--- a/l3trial/l3htoks/testfiles/m3htoks001.tlg
+++ b/l3kernel/testfiles/m3clist007.tlg
@@ -1,49 +1,65 @@
 This is a generated file for the LaTeX (2e + expl3) validation system.
 Don't change this file in any respect.
 ============================================================
-TEST 1: Simple text
+TEST 1: \q_mark and \clist_reverse:N 
 ============================================================
-Abc def.
+The comma list \l_test_clist contains the items (without outer braces):
+>  {b}
+>  {\q_mark }
+>  {a}.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
-TEST 2: Simple text and math
+TEST 2: \q_stop and \clist_get:NN 
 ============================================================
-Abc def $(a,b)$.
+The comma list \l_test_tl contains the items (without outer braces):
+>  {a}.
+<recently read> }
+l. ...  }
+> \l_test_tl=a.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
-TEST 3: Superscripts, subscripts
+TEST 3: \q_stop and \clist_pop:NN 
 ============================================================
-Abc def $(a^{b}_{c})$.
+The comma list \l_test_tl contains the items (without outer braces):
+>  {a}.
+<recently read> }
+l. ...  }
+> \l_test_tl=a.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
-TEST 4: hspace
+TEST 4: \q_stop and \clist_item:Nn 
 ============================================================
-Abc\hspace {5.0pt}def\group_begin: \group_end: \hspace *{5.0pt}ghi
+> \l_test_tl=a.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
-TEST 5: font changes
+TEST 5: \q_recursion_tail and \clist_map_function:NN 
 ============================================================
-> \l_tmpa_tl=A \group_begin: \htoks_font:n {cmr12 at 14.4pt}\group_end:
-\htoks_font:n {cmr12 at 14.4pt}b {\group_begin: \htoks_font:n {cmbx12 at
-14.4pt}\group_end: \htoks_font:n {cmbx12 at 14.4pt}cd, {\group_begin:
-\htoks_font:n {cmbxti10 at 14.4pt}\group_end: \htoks_font:n {cmbxti10 at
-14.4pt}ef}!} {\group_begin: \htoks_font:n {cmcsc10 at 14.4pt}\group_end:
-\htoks_font:n {cmcsc10 at 14.4pt}bar}..
-<recently read> }
-l. ...  }
+a
+\q_recursion_tail 
+b
 ============================================================
 ============================================================
-TEST 6: label and ref
+TEST 6: \q_recursion_tail with \q_recursion_stop and \clist_map_function:NN 
 ============================================================
-> \l_tmpa_tl=a\group_begin: \write \@auxout {\newlabel{b}{{}{2}}}\group_end: :
-on page 2.
-<recently read> }
-l. ...  }
+a
+\q_recursion_tail 
+b
+\q_recursion_stop 
+c
 ============================================================
 ============================================================
-TEST 7: non-breakable space
+TEST 7: \q_nil and \clist_set:Nn 
 ============================================================
-Hello\penalty 10000 \ {}world!
+The comma list \l_test_clist contains the items (without outer braces):
+>  {u\q_nil v}.
+<recently read> }
+l. ...  }
 ============================================================
-[2
-] (m3htoks001.aux)





More information about the latex3-commits mailing list.