[latex3-commits] [git/LaTeX3-latex3-latex3] master: Correct a test file (impossible to break out of \int_step_inline) (76671b527)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Jul 16 12:13:16 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/76671b527efd8fbf3ba5839846a43a44e4ead505
>---------------------------------------------------------------
commit 76671b527efd8fbf3ba5839846a43a44e4ead505
Author: Bruno Le Floch <bruno at le-floch.fr>
Date: Mon Jun 29 06:38:10 2020 +0200
Correct a test file (impossible to break out of \int_step_inline)
>---------------------------------------------------------------
76671b527efd8fbf3ba5839846a43a44e4ead505
l3kernel/testfiles/m3cctab001.lvt | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/l3kernel/testfiles/m3cctab001.lvt b/l3kernel/testfiles/m3cctab001.lvt
index 4fb5e832e..a5d1970f6 100644
--- a/l3kernel/testfiles/m3cctab001.lvt
+++ b/l3kernel/testfiles/m3cctab001.lvt
@@ -16,7 +16,6 @@
\ExplSyntaxOn
\OMIT
-\cctab_new:N \c_initex_cctab
\intarray_new:Nn \TESTintarrayA { 256 }
\intarray_new:Nn \TESTintarrayB { 256 }
\cs_new:Npn \SAVECATCODES #1
@@ -27,17 +26,27 @@
{ \char_value_catcode:n {##1-1} }
}
}
-\prg_new_conditional:Npnn \intarray_if_eq:NN #1 #2 { TF }
+\tl_new:N \l__test_tl
+\prg_new_protected_conditional:Npnn \intarray_if_eq:NN #1 #2 { TF }
{
+ \tl_clear:N \l__test_tl
\int_step_inline:nnn { 1 } { 256 }
{
\int_compare:nNnF
{ \intarray_item:Nn #1 {##1} }
=
{ \intarray_item:Nn #2 {##1} }
- { \prg_break:n { \use_i:nn \prg_return_false: } }
+ {
+ \tl_put_right:Nx \l__test_tl
+ {
+ '\char_generate:nn { ##1 - 1 } { 12 }'
+ ( \intarray_item:Nn #1 {##1} != \intarray_item:Nn #2 {##1}) ~
+ }
+ }
}
- \prg_return_true:
+ \tl_if_empty:NTF \l__test_tl
+ { \prg_return_true: }
+ { \prg_return_false: }
}
\cs_new_eq:NN \IntarrayIfEqTF \intarray_if_eq:NNTF
\TIMO
@@ -55,7 +64,7 @@
\cctab_end:
\cctab_end:
\IntarrayIfEqTF \TESTintarrayA \TESTintarrayB
- { \TYPE { OK } } { \TYPE { Sob~T_T } }
+ { \TYPE { OK } } { \TYPE { Sob~T_T~\l__test_tl } }
}
\TEST { cctab_begin / iniTeX~in~code }
@@ -70,7 +79,7 @@
\cctab_end:
\cctab_end:
\IntarrayIfEqTF \TESTintarrayA \TESTintarrayB
- { \TYPE { OK } } { \TYPE { Sob~T_T } }
+ { \TYPE { OK } } { \TYPE { Sob~T_T~\l__test_tl } }
}
\TEST { cctab_begin / str~in~document }
@@ -85,7 +94,7 @@
\cctab_end:
\cctab_end:
\IntarrayIfEqTF \TESTintarrayA \TESTintarrayB
- { \TYPE { OK } } { \TYPE { Sob~T_T } }
+ { \TYPE { OK } } { \TYPE { Sob~T_T~\l__test_tl } }
}
\TEST { cctab_begin / document~in~str }
@@ -100,7 +109,7 @@
\cctab_end:
\cctab_end:
\IntarrayIfEqTF \TESTintarrayA \TESTintarrayB
- { \TYPE { OK } } { \TYPE { Sob~T_T } }
+ { \TYPE { OK } } { \TYPE { Sob~T_T~\l__test_tl } }
}
@@ -117,7 +126,7 @@
\SAVECATCODES \TESTintarrayB
\group_end:
\IntarrayIfEqTF \TESTintarrayA \TESTintarrayB
- { \TYPE { OK } } { \TYPE { Sob~T_T } }
+ { \TYPE { OK } } { \TYPE { Sob~T_T~\l__test_tl } }
}
\ExplSyntaxOff
More information about the latex3-commits
mailing list.