[latex3-commits] [git/LaTeX3-latex3-latex3] master: Add tests for \dim_step_ functions (and correct copy-paste typos) (e4154eb)

Bruno Le Floch bruno at le-floch.fr
Sun Feb 18 16:08:44 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/e4154eb546a293c6a68369f4aabeb60f94062887

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

commit e4154eb546a293c6a68369f4aabeb60f94062887
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sun Feb 18 10:08:44 2018 -0500

    Add tests for \dim_step_ functions (and correct copy-paste typos)


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

e4154eb546a293c6a68369f4aabeb60f94062887
 l3kernel/l3skip.dtx              |    4 +-
 l3kernel/testfiles/m3skip006.lvt |   47 +++++++++++++++++++++
 l3kernel/testfiles/m3skip006.tlg |   84 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 133 insertions(+), 2 deletions(-)

diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index f7eaf58..65289fc 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -389,7 +389,7 @@
 % \section{Dimension step functions}
 %
 % \begin{function}[added = 2018-02-18, rEXP]
-%   {\int_step_function:nnnN}
+%   {\dim_step_function:nnnN}
 %   \begin{syntax}
 %     \cs{dim_step_function:nnnN} \Arg{initial value} \Arg{step} \Arg{final value} \meta{function}
 %   \end{syntax}
@@ -1598,7 +1598,7 @@
 % \begin{macro}{\@@_step:NNnnnn}
 %   The approach here is to build a function, with a global integer
 %   required to make the nesting safe (as seen in other in line
-%   functions), and map that function using \cs{int_step_function:nnnN}.
+%   functions), and map that function using \cs{dim_step_function:nnnN}.
 %   We put a \cs{__prg_break_point:Nn} so that \texttt{map_break}
 %   functions from other modules correctly decrement \cs{g__prg_map_int}
 %   before looking for their own break point.  The first argument is
diff --git a/l3kernel/testfiles/m3skip006.lvt b/l3kernel/testfiles/m3skip006.lvt
new file mode 100644
index 0000000..49607f9
--- /dev/null
+++ b/l3kernel/testfiles/m3skip006.lvt
@@ -0,0 +1,47 @@
+%
+% Copyright (C) 2018 LaTeX3 Project
+%
+
+\documentclass{minimal}
+\input{regression-test}
+
+\RequirePackage[check-declarations,log-functions]{expl3}
+
+\begin{document}
+\START
+\AUTHOR{Bruno Le Floch}
+\ExplSyntaxOn
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\TESTEXP { dim_step_function }
+  {
+    \dim_step_function:nnnN { 0pt } { 0.1pt }  { 1pt } \TYPE
+    \NEWLINE
+    \dim_step_function:nnnN { 0pt } { -0.1pt } { 1pt } \TYPE
+    \NEWLINE
+    \dim_step_function:nnnN { 1pt } { -0.1pt } { 0pt } \TYPE
+    \NEWLINE
+    \dim_step_function:nnnN { 1pt } { 0.1pt }  { 0pt } \TYPE
+    \NEWLINE
+    \dim_step_function:nnnN { 1pt } { 0pt }  { 0pt } \TYPE
+  }
+
+\TEST { dim_step_inline }
+  {
+    \dim_step_inline:nnnn { 0pt } { 0.1pt }  { 1pt } { \TYPE {#1} }
+    \dim_step_inline:nnnn { 0pt } { -0.1pt } { 1pt } { \TYPE {#1} }
+    \dim_step_inline:nnnn { 1pt } { -0.1pt } { 0pt } { \TYPE {#1} }
+    \dim_step_inline:nnnn { 1pt } { 0.1pt }  { 0pt } { \TYPE {#1} }
+    \dim_step_inline:nnnn { 1pt } { 0pt }    { 0pt } { \TYPE {#1} }
+  }
+
+\TEST { dim_step_variable }
+  {
+    \dim_step_variable:nnnNn { 0pt } { 0.1pt }  { 1pt } \l_tmpa_tl { \TYPE { \tl_to_str:N \l_tmpa_tl # } }
+    \dim_step_variable:nnnNn { 0pt } { -0.1pt } { 1pt } \l_tmpa_tl { \TYPE { \l_tmpa_tl } }
+    \dim_step_variable:nnnNn { 1pt } { -0.1pt } { 0pt } \l_tmpa_tl { \TYPE { \l_tmpa_tl } }
+    \dim_step_variable:nnnNn { 1pt } { 0.1pt }  { 0pt } \l_tmpa_tl { \TYPE { \l_tmpa_tl } }
+    \dim_step_variable:nnnNn { 1pt } { 0pt }    { 0pt } \l_tmpa_tl { \TYPE { \l_tmpa_tl } }
+  }
+
+\END
diff --git a/l3kernel/testfiles/m3skip006.tlg b/l3kernel/testfiles/m3skip006.tlg
new file mode 100644
index 0000000..2ad25c5
--- /dev/null
+++ b/l3kernel/testfiles/m3skip006.tlg
@@ -0,0 +1,84 @@
+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: dim_step_function
+============================================================
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Zero step size for step function \TYPE .
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+0.0pt0.1pt0.20001pt0.30002pt0.40002pt0.50003pt0.60004pt0.70004pt0.80005pt0.90005pt
+1.0pt0.9pt0.79999pt0.69998pt0.59998pt0.49997pt0.39996pt0.29996pt0.19995pt0.09995pt
+============================================================
+============================================================
+TEST 2: dim_step_inline
+============================================================
+0.0pt
+0.1pt
+0.20001pt
+0.30002pt
+0.40002pt
+0.50003pt
+0.60004pt
+0.70004pt
+0.80005pt
+0.90005pt
+1.0pt
+0.9pt
+0.79999pt
+0.69998pt
+0.59998pt
+0.49997pt
+0.39996pt
+0.29996pt
+0.19995pt
+0.09995pt
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Zero step size for step function \__prg_map_1:w .
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+============================================================
+============================================================
+TEST 3: dim_step_variable
+============================================================
+0.0pt##
+0.1pt##
+0.20001pt##
+0.30002pt##
+0.40002pt##
+0.50003pt##
+0.60004pt##
+0.70004pt##
+0.80005pt##
+0.90005pt##
+1.0pt
+0.9pt
+0.79999pt
+0.69998pt
+0.59998pt
+0.49997pt
+0.39996pt
+0.29996pt
+0.19995pt
+0.09995pt
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Zero step size for step function \__prg_map_1:w .
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+============================================================





More information about the latex3-commits mailing list