[latex3-commits] [latex3/latex3] main: Test \maxdimen conversions and document detail (9c713ff3d)
github at latex-project.org
github at latex-project.org
Mon May 22 11:19:55 CEST 2023
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/9c713ff3d3e69a68c3bf9c29bae6086f901125dd
>---------------------------------------------------------------
commit 9c713ff3d3e69a68c3bf9c29bae6086f901125dd
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon May 22 10:13:14 2023 +0100
Test \maxdimen conversions and document detail
>---------------------------------------------------------------
9c713ff3d3e69a68c3bf9c29bae6086f901125dd
l3kernel/l3skip.dtx | 6 ++-
l3kernel/testfiles/m3skip002.lvt | 26 +++++++++++++
l3kernel/testfiles/m3skip002.tlg | 80 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 111 insertions(+), 1 deletion(-)
diff --git a/l3kernel/l3skip.dtx b/l3kernel/l3skip.dtx
index fc8a93494..49dd0420d 100644
--- a/l3kernel/l3skip.dtx
+++ b/l3kernel/l3skip.dtx
@@ -555,7 +555,7 @@
% and \texttt{sp}. An input value equal to \cs{c_max_dim} in any other units
% will result in an overflow, as it will convert to an internal value
% (in \texttt{sp}) which is too large. As such, the maximum input values in
-% different units are\\
+% different units two five decimal places are\\
% \begin{center}
% \begin{tabular}{@{}>{$}r<{$}@{\,}l@{}}
% 1276.00215 & cc \\
@@ -567,6 +567,10 @@
% 1365.33333 & pc \\
% \end{tabular}
% \end{center}
+% Values given to five decimal places larger that these will result in \TeX{}
+% errors; the behavior if additional decimal places are given depends on the
+% \TeX{} internals and thus larger values are \emph{not} supported by
+% \pkg{expl3}.
% \begin{texnote}
% The implementation of this functions is re-entrant: the result of
% \begin{verbatim}
diff --git a/l3kernel/testfiles/m3skip002.lvt b/l3kernel/testfiles/m3skip002.lvt
index a17341030..24fcf1749 100644
--- a/l3kernel/testfiles/m3skip002.lvt
+++ b/l3kernel/testfiles/m3skip002.lvt
@@ -246,4 +246,30 @@
\dim_to_decimal_in_unit:nn { 1 bp pt } { 1 mm } \NEWLINE
}
+\TESTEXP { \c_max_dim conversion }
+ {
+ \dim_to_decimal_in_bp:n { 16322.78954bp } \NEWLINE
+ \dim_to_decimal_in_cc:n { 1276.00215cc } \NEWLINE
+ \dim_to_decimal_in_cm:n { 575.83174cm } \NEWLINE
+ \dim_to_decimal_in_dd:n { 15312.02584dd } \NEWLINE
+ \dim_to_decimal_in_in:n { 226.70540in } \NEWLINE
+ \dim_to_decimal_in_nc:n { 1279.62627nc } \NEWLINE
+ \dim_to_decimal_in_nd:n { 15355.51532nd } \NEWLINE
+ \dim_to_decimal_in_mm:n { 5758.31742mm } \NEWLINE
+ \dim_to_decimal_in_pc:n { 1365.33333pc }
+ }
+
+\TESTEXP { \c_max_dim conversion~errors }
+ {
+ \dim_to_decimal_in_bp:n { 16322.78955bp } \NEWLINE
+ \dim_to_decimal_in_cc:n { 1276.00216cc } \NEWLINE
+ \dim_to_decimal_in_cm:n { 575.83175cm } \NEWLINE
+ \dim_to_decimal_in_dd:n { 15312.02585dd } \NEWLINE
+ \dim_to_decimal_in_in:n { 226.70541in } \NEWLINE
+ \dim_to_decimal_in_nc:n { 1279.62628nc } \NEWLINE
+ \dim_to_decimal_in_nd:n { 15355.51533nd } \NEWLINE
+ \dim_to_decimal_in_mm:n { 5758.31743mm } \NEWLINE
+ \dim_to_decimal_in_pc:n { 1365.33334pc }
+ }
+
\END
diff --git a/l3kernel/testfiles/m3skip002.tlg b/l3kernel/testfiles/m3skip002.tlg
index 5c7e9c354..60d894c18 100644
--- a/l3kernel/testfiles/m3skip002.tlg
+++ b/l3kernel/testfiles/m3skip002.tlg
@@ -146,3 +146,83 @@ since the result is out of range.
0.75003
0)*32768/186467\__int_eval_end: sp\__dim_eval_end:
============================================================
+============================================================
+TEST 12: \c_max_dim conversion
+============================================================
+16322.78954
+1276.00215
+575.83174
+15312.02583
+226.7054
+1279.62627
+15355.51532
+5758.31741
+1365.33333
+============================================================
+============================================================
+TEST 13: \c_max_dim conversion errors
+============================================================
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+! Dimension too large.
+<to be read again>
+ \__dim_eval_end:
+l. ... }
+I can't work with sizes bigger than about 19 feet.
+Continue and I'll use the largest value I can.
+16322.78954
+1276.00215
+575.83174
+15312.02585
+226.70541
+1279.62628
+15355.51532
+5758.31741
+1365.33333
+============================================================
More information about the latex3-commits
mailing list.