[latex3-commits] [git/LaTeX3-latex3-latex3] scan-quark: Add tests for quark-break tests and for errors (c223e9581)
PhelypeOleinik
tex.phelype at gmail.com
Wed Mar 18 20:30:11 CET 2020
Repository : https://github.com/latex3/latex3
On branch : scan-quark
Link : https://github.com/latex3/latex3/commit/c223e95815c10acd1a4ed8a5239ada3dcb3422ac
>---------------------------------------------------------------
commit c223e95815c10acd1a4ed8a5239ada3dcb3422ac
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date: Wed Mar 18 16:30:11 2020 -0300
Add tests for quark-break tests and for errors
>---------------------------------------------------------------
c223e95815c10acd1a4ed8a5239ada3dcb3422ac
l3kernel/testfiles/m3quark002.lvt | 27 +++++++++++++++++++++
l3kernel/testfiles/m3quark002.tlg | 51 ++++++++++++++++++++++++++++++++++++---
2 files changed, 75 insertions(+), 3 deletions(-)
diff --git a/l3kernel/testfiles/m3quark002.lvt b/l3kernel/testfiles/m3quark002.lvt
index 382b28705..dfd49a0cd 100644
--- a/l3kernel/testfiles/m3quark002.lvt
+++ b/l3kernel/testfiles/m3quark002.lvt
@@ -54,6 +54,24 @@
\cs_log:N \__test_use_i_delimit_by_q_test_recursion_stop:nw
}
+\TEST{New~private~quark~functions~(:nN)}{
+ \__kernel_quark_test_generate:NNNn
+ \__test_quark_if_recursion_tail_break:nN
+ \q__test_recursion_tail \q__test_recursion_stop { __test }
+ \cs_log:N \__test_quark_if_recursion_tail_break:nN
+ \cs_log:N \__test_if_test_recursion_tail:w
+ \cs_log:N \__test_use_i_delimit_by_q_test_recursion_stop:nw
+}
+
+\TEST{New~private~quark~functions~(:NN)}{
+ \__kernel_quark_test_generate:NNNn
+ \__test_quark_if_recursion_tail_break:NN
+ \q__test_recursion_tail \q__test_recursion_stop { __test }
+ \cs_log:N \__test_quark_if_recursion_tail_break:NN
+ \cs_log:N \__test_if_test_recursion_tail:w
+ \cs_log:N \__test_use_i_delimit_by_q_test_recursion_stop:nw
+}
+
\TESTEXP{Inside~recursions~(expect~nothing)}{
\__test_quark_if_recursion_tail_stop:n
{\q__test_recursion_tail} \ERROR \q__test_recursion_stop
@@ -79,4 +97,13 @@
\__test_quark_if_recursion_tail_stop_do:nn {{ab\iffalse}\fi}{ \ERROR }
}
+\TEST{Invalid~signatures~(expect~errors)}{
+ \__kernel_quark_test_generate:NNNn
+ \__test_quark_if_recursion_tail_break:nnn
+ \q__test_recursion_tail \q__test_recursion_stop { __test }
+ \__kernel_quark_test_generate:NNNn
+ \__test_quark_if_recursion_tail_break
+ \q__test_recursion_tail \q__test_recursion_stop { __test }
+}
+
\END
diff --git a/l3kernel/testfiles/m3quark002.tlg b/l3kernel/testfiles/m3quark002.tlg
index 3d6b42885..0d47a91ef 100644
--- a/l3kernel/testfiles/m3quark002.tlg
+++ b/l3kernel/testfiles/m3quark002.tlg
@@ -53,15 +53,60 @@ Defining \__test_quark_if_recursion_tail_stop_do:Nn on line ...
macro:#1#2\q__test_recursion_stop ->#1.
============================================================
============================================================
-TEST 5: Inside recursions (expect nothing)
+TEST 5: New private quark functions (:nN)
+============================================================
+Defining \__test_quark_if_recursion_tail_break:nN on line ...
+> \__test_quark_if_recursion_tail_break:nN=\long macro:#1#2->\tl_if_empty:oTF
+{\__test_if_test_recursion_tail:w {}#1{}?!\q__test_recursion_tail ??!}{#2}{}.
+> \__test_if_test_recursion_tail:w=\long macro:#1\q__test_recursion_tail
+#2?#3?!->#1#2.
+> \__test_use_i_delimit_by_q_test_recursion_stop:nw=\long
+macro:#1#2\q__test_recursion_stop ->#1.
============================================================
============================================================
+TEST 6: New private quark functions (:NN)
============================================================
-TEST 6: Inside recursions (expect `YESYESYESYES')
+Defining \__test_quark_if_recursion_tail_break:NN on line ...
+> \__test_quark_if_recursion_tail_break:NN=\long macro:#1#2->\if_meaning:w
+\q__test_recursion_tail #1\exp_after:wN #2\fi: .
+> \__test_if_test_recursion_tail:w=\long macro:#1\q__test_recursion_tail
+#2?#3?!->#1#2.
+> \__test_use_i_delimit_by_q_test_recursion_stop:nw=\long
+macro:#1#2\q__test_recursion_stop ->#1.
+============================================================
+============================================================
+TEST 7: Inside recursions (expect nothing)
+============================================================
+============================================================
+============================================================
+TEST 8: Inside recursions (expect `YESYESYESYES')
============================================================
YESYESYESYES
============================================================
============================================================
-TEST 7: Recursion edge cases (expect nothing)
+TEST 9: Recursion edge cases (expect nothing)
+============================================================
+============================================================
+============================================================
+TEST 10: Invalid signatures (expect errors)
============================================================
+! LaTeX3 Error: Quark test function
+(LaTeX3) '\__test_quark_if_recursion_tail_break:nnn' is invalid.
+For immediate help type H <return>.
+ ...
+l. ...}
+This is a coding error.
+LaTeX has been asked to create quark test function
+'\__test_quark_if_recursion_tail_break:nnn' with signature 'nnn', but that
+signature is not valid.
+! LaTeX3 Error: Function '\__test_quark_if_recursion_tail_break' contains no
+(LaTeX3) ':'.
+For immediate help type H <return>.
+ ...
+l. ...}
+This is a coding error.
+Code-level functions must contain ':' to separate the argument specification
+from the function name. This is needed when defining conditionals or variants,
+or when building a parameter text from the number of arguments of the
+function.
============================================================
More information about the latex3-commits
mailing list.