[latex3-commits] [l3svn] r6930 - Remove numbered integer constants in l3kernel test files (see #316)
noreply at latex-project.org
noreply at latex-project.org
Wed Feb 15 14:36:08 CET 2017
Author: bruno
Date: 2017-02-15 14:36:08 +0100 (Wed, 15 Feb 2017)
New Revision: 6930
Modified:
trunk/l3kernel/testfiles/m3compare001.lvt
trunk/l3kernel/testfiles/m3fp-convert001.lvt
trunk/l3kernel/testfiles/m3fp-parse002.lvt
trunk/l3kernel/testfiles/m3fp002.lvt
trunk/l3kernel/testfiles/m3fp002.tlg
trunk/l3kernel/testfiles/m3show001.lvt
trunk/l3kernel/testfiles/m3show001.tlg
trunk/l3kernel/testfiles/m3show003.luatex.tlg
trunk/l3kernel/testfiles/m3show003.lvt
trunk/l3kernel/testfiles/m3show003.tlg
trunk/l3kernel/testfiles/m3skip005.lvt
trunk/l3kernel/testfiles/m3sort002.lvt
trunk/l3kernel/testfiles/m3str003.lvt
Log:
Remove numbered integer constants in l3kernel test files (see #316)
These files are easy, with not too many constants.
Modified: trunk/l3kernel/testfiles/m3compare001.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3compare001.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3compare001.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -51,15 +51,15 @@
\OMIT
\tl_set:Nn \l_test_compare_name_tl { int_compare }
\cs_set_eq:NN \test_eval:n \int_eval:n
+\int_set:Nn \l_tmpa_int { 1 } \int_set:Nn \l_tmpb_int { 3 }
\TIMO
-
\TESTEXP { Comparing~integers }
{
\test:nn { 1 } { 1 }
\test:nn { -01 } { - 3 + 2 }
\test:nn { 1 } { 2 }
\test:nn { -1 } { -2 }
- \test:nn { -2 + -12 } { -\c_one * \c_three }
+ \test:nn { -2 + -12 } { -\l_tmpa_int * \l_tmpb_int }
}
\TESTEXP { Erroneous~integer~comparisons }
@@ -69,7 +69,7 @@
}
\OMIT
-\cs_set_eq:NN \? \c_zero % non-expandable cs with a short name
+\cs_set_eq:NN \? \tex_def:D % non-expandable cs with a short name
\TIMO
\TESTEXP { Some~more~erroneous~comparisons }
{
Modified: trunk/l3kernel/testfiles/m3fp-convert001.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3fp-convert001.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3fp-convert001.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -11,7 +11,6 @@
\START
\AUTHOR{Bruno Le Floch}
\ExplSyntaxOn
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST{Constants}{
\fp_const:Nn \c_minus_one_fp { -1 }
@@ -19,8 +18,9 @@
\fp_const:Nn \c_my_pi_fp { - \c_minus_pi_fp }
\cs_if_eq:NNF \c_my_pi_fp \c_pi_fp { \ERROR }
}
+\fp_set:Nn \l_tmpa_fp { 1 }
\TESTEXP{Show~constants}{
- \fp_to_tl:N \c_one_fp \NEWLINE
+ \fp_to_tl:N \l_tmpa_fp \NEWLINE
\fp_to_tl:N \c_minus_one_fp \NEWLINE
\fp_to_tl:N \c_minus_pi_fp \NEWLINE
\fp_to_tl:N \c_pi_fp \NEWLINE
@@ -81,10 +81,10 @@
\fp_to_tl:n {987654321098765550} \NEWLINE
\fp_to_tl:n {987654321098765551} \NEWLINE
}
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\int_set:Nn \l_tmpa_int { 12 } \int_set:Nn \l_tmpb_int { 1 }
\TESTEXP{Unpacking}{
- \fp_to_tl:n {\c_twelve e-\c_one} \NEWLINE
+ \fp_to_tl:n {\l_tmpa_int e-\l_tmpb_int} \NEWLINE
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -114,8 +114,8 @@
\fp_to_tl:n {-345728342345678912345.67e-100} \NEWLINE
\fp_to_tl:n {-3457283423456789123456.78e-100} \NEWLINE
}
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\int_set:Nn \l_tmpa_int { 0 } \fp_set:Nn \l_tmpa_fp { 0 }
\TESTEXP{Zeros}{
\fp_to_tl:n {-0000000000000000000.0000000000e-142345435} \NEWLINE
\fp_to_tl:n {-0000000000000000000.e-142345435} \NEWLINE
@@ -125,8 +125,8 @@
\fp_to_tl:n {-0000000000000000000.} \NEWLINE
\fp_to_tl:n {.0} \NEWLINE
\fp_to_tl:n {.} \NEWLINE
- \fp_to_tl:n { \c_zero } \NEWLINE
- \fp_to_tl:n { +- \c_zero_fp } \NEWLINE
+ \fp_to_tl:n { \l_tmpa_int } \NEWLINE
+ \fp_to_tl:n { +- \l_tmpa_fp } \NEWLINE
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Modified: trunk/l3kernel/testfiles/m3fp-parse002.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3fp-parse002.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3fp-parse002.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -22,18 +22,18 @@
\fp_new:N \X
\fp_set:Nn \X { -1.2 }
\cs_set_nopar:Npn \kilo { e3 }
+\int_set:Nn \l_tmpa_int { 2 } \int_set:Nn \l_tmpb_int { 3 } \int_const:Nn \c_test_one_int { 1 }
\TIMO
-
\TESTEXP { Expansion }
{
- \fp_eval:n { \1\2\3{\4}\.\+\2 * \c_two\*\use:n{\*}\c_three e-\c_one }
+ \fp_eval:n { \1\2\3{\4}\.\+\2 * \l_tmpa_int\*\use:n{\*}\l_tmpb_int e-\c_test_one_int }
\NEWLINE
\fp_eval:n { \X * \2 \X - ( \X ** \3 ) \X } \NEWLINE
\fp_eval:n { \X * \relax && 2 } \NEWLINE
\fp_to_tl:n { 2 \kilo 3 } ~
- \fp_to_tl:n { 2 \kilo \c_three } ~
- \fp_to_tl:n { \c_two \kilo 3 } ~
- \fp_to_tl:n { \c_two \kilo \c_three } \NEWLINE
+ \fp_to_tl:n { 2 \kilo \l_tmpb_int } ~
+ \fp_to_tl:n { \l_tmpa_int \kilo 3 } ~
+ \fp_to_tl:n { \l_tmpa_int \kilo \l_tmpb_int } \NEWLINE
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Modified: trunk/l3kernel/testfiles/m3fp002.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3fp002.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3fp002.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -128,6 +128,7 @@
\fp_show:N \c_nan_fp
\fp_show:N \c_minus_zero_fp
\fp_show:N \c_zero_fp
+ \fp_show:N \c_one_fp
\fp_show:n { pi }
\fp_show:n { inf }
\fp_show:n { -inf }
Modified: trunk/l3kernel/testfiles/m3fp002.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3fp002.tlg 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3fp002.tlg 2017-02-15 13:36:08 UTC (rev 6930)
@@ -181,6 +181,9 @@
> \c_zero_fp=0.
<recently read> }
l. ... }
+> \c_one_fp=1.
+<recently read> }
+l. ... }
> pi=3.141592653589793.
<recently read> }
l. ... }
Modified: trunk/l3kernel/testfiles/m3show001.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3show001.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3show001.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -106,11 +106,12 @@
{ \c_true_bool && !( \int_compare_p:n { 1=2 } || \c_true_bool ) }
}
+\fp_set:Nn \l_tmpa_fp { 1 }
\TEST { FP }
{
- \fp_show:N \c_one_fp
+ \fp_show:N \l_tmpa_fp
\fp_show:n { 1 + 2 }
- \fp_show:n { \c_one_fp }
+ \fp_show:n { \l_tmpa_fp }
}
\END
Modified: trunk/l3kernel/testfiles/m3show001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3show001.tlg 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3show001.tlg 2017-02-15 13:36:08 UTC (rev 6930)
@@ -173,13 +173,13 @@
============================================================
TEST 11: FP
============================================================
-> \c_one_fp=1.
+> \l_tmpa_fp=1.
<recently read> }
l. ... }
> 1+2=3.
<recently read> }
l. ... }
-> \c_one_fp =1.
+> \l_tmpa_fp =1.
<recently read> }
l. ... }
============================================================
Modified: trunk/l3kernel/testfiles/m3show003.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3show003.luatex.tlg 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3show003.luatex.tlg 2017-02-15 13:36:08 UTC (rev 6930)
@@ -143,7 +143,7 @@
============================================================
TEST 6: fp
============================================================
-> \c_one_fp=1.
+> \l_tmpa_fp=1.
> \c_pi_fp=3.141592653589793.
> 1+2=3.
============================================================
@@ -151,7 +151,7 @@
TEST 7: int
============================================================
> \l_tmpa_int=5.
-> \c_sixteen=16.
+> \c_test_int=16.
> 2+3*\l_tmpa_int =17.
============================================================
============================================================
Modified: trunk/l3kernel/testfiles/m3show003.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3show003.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3show003.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -100,20 +100,20 @@
\dim_log:n { 2.3 \l_tmpa_dim }
}
-
+\fp_set:Nn \l_tmpa_fp { 1 }
\TEST { fp }
{
- \fp_log:N \c_one_fp
+ \fp_log:N \l_tmpa_fp
\fp_log:c { c_pi_fp }
\fp_log:n { 1 + 2 }
}
-
+\OMIT \int_const:Nn \c_test_int { 16 } \TIMO
\TEST { int }
{
\int_add:Nn \l_tmpa_int { 5 }
\int_log:N \l_tmpa_int
- \int_log:c { c_sixteen }
+ \int_log:c { c_test_int }
\int_log:n { 2 + 3 * \l_tmpa_int }
}
Modified: trunk/l3kernel/testfiles/m3show003.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3show003.tlg 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3show003.tlg 2017-02-15 13:36:08 UTC (rev 6930)
@@ -143,7 +143,7 @@
============================================================
TEST 6: fp
============================================================
-> \c_one_fp=1.
+> \l_tmpa_fp=1.
> \c_pi_fp=3.141592653589793.
> 1+2=3.
============================================================
@@ -151,7 +151,7 @@
TEST 7: int
============================================================
> \l_tmpa_int=5.
-> \c_sixteen=16.
+> \c_test_int=16.
> 2+3*\l_tmpa_int =17.
============================================================
============================================================
Modified: trunk/l3kernel/testfiles/m3skip005.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3skip005.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3skip005.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -13,12 +13,12 @@
\START
\AUTHOR{Bruno Le Floch}
\ExplSyntaxOn
-
+\int_set:Nn \l_tmpa_int { 2 }
\TEST { Constants }
{
{
\dim_const:Nn \c_my_dim { 1sp + 0mm * 2 }
- \skip_const:Nn \c_my_skip { 1sp plus 5.324fil minus 0.001 fil * \c_two }
+ \skip_const:Nn \c_my_skip { 1sp plus 5.324fil minus 0.001 fil * \l_tmpa_int }
\muskip_const:Nn \c_my_muskip { 0.00001 mu plus 3fill }
}
\dim_log:N \c_my_dim
Modified: trunk/l3kernel/testfiles/m3sort002.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3sort002.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3sort002.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -36,7 +36,7 @@
\OMIT
\prg_set_conditional:Npnn \test_compare:nn #1#2 { TF }
{
- \if_int_compare:w \__str_if_eq_x:nn {#1} {#2} > \c_zero
+ \if_int_compare:w \__str_if_eq_x:nn {#1} {#2} > 0 \exp_stop_f:
\prg_return_false:
\else:
\prg_return_true:
Modified: trunk/l3kernel/testfiles/m3str003.lvt
===================================================================
--- trunk/l3kernel/testfiles/m3str003.lvt 2017-02-14 15:53:00 UTC (rev 6929)
+++ trunk/l3kernel/testfiles/m3str003.lvt 2017-02-15 13:36:08 UTC (rev 6930)
@@ -187,12 +187,12 @@
| \str_item_ignore_spaces:nn { ~ } { -1 }
|
}
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\int_set:Nn \l_tmpa_int { 1 } \int_set:Nn \l_tmpb_int { 2 }
\TESTEXP { str~from~to }
{
| \str_range:Nnn \l_foo_str { 1 } { 3 }
- | \str_range:Nnn \l_foo_str { \c_two } { \c_one }
+ | \str_range:Nnn \l_foo_str { \l_tmpb_int } { \l_tmpa_int }
| \str_range:Nnn \l_foo_str { 2 } { 5 }
| \str_range:Nnn \l_foo_str { 6 } { 8+1 }
| \str_range:Nnn \l_foo_str { 17 } { 17 }
More information about the latex3-commits
mailing list