[latex3-commits] [git/LaTeX3-latex3-latex2e] removecallback: Add tests for mlist_to_hlist etc. (ed185654)

Marcel Fabian Krüger tex at 2krueger.de
Sat Mar 7 00:13:20 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : removecallback
Link       : https://github.com/latex3/latex2e/commit/ed185654588f9e37dfeb4deed4ebdbf8b8b781e1

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

commit ed185654588f9e37dfeb4deed4ebdbf8b8b781e1
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sat Mar 7 00:08:56 2020 +0100

    Add tests for mlist_to_hlist etc.


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

ed185654588f9e37dfeb4deed4ebdbf8b8b781e1
 ...ithub-0203.tlg => tlb-mathcallbacks.luatex.tlg} | 11 +++++---
 base/testfiles/tlb-mathcallbacks.lvt               | 31 ++++++++++++++++++++++
 ...ithub-0060.luatex.tlg => tlb-mathcallbacks.tlg} |  0
 3 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/base/testfiles/github-0203.tlg b/base/testfiles/tlb-mathcallbacks.luatex.tlg
similarity index 50%
copy from base/testfiles/github-0203.tlg
copy to base/testfiles/tlb-mathcallbacks.luatex.tlg
index b75dae15..25d531b5 100644
--- a/base/testfiles/github-0203.tlg
+++ b/base/testfiles/tlb-mathcallbacks.luatex.tlg
@@ -1,10 +1,13 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-Top-level: macro:->a\\b
-In box: macro:->a\\b
+Inserting `test' at position 1 in `pre_mlist_to_hlist_filter'.
 LaTeX Font Info:    External font `cmex10' loaded for size
 (Font)              <7> on input line ....
 LaTeX Font Info:    External font `cmex10' loaded for size
 (Font)              <5> on input line ....
-Raggedright: macro:->a\\b
-Raggedleft: macro:->a\\b
+pre_mlist_to_hlist_filter called
+Inserting `test' at position 1 in `mlist_to_hlist'.
+pre_mlist_to_hlist_filter called
+mlist_to_hlist called
+Removing  `test' from `mlist_to_hlist'.
+Inserting `test' at position 1 in `mlist_to_hlist'.
diff --git a/base/testfiles/tlb-mathcallbacks.lvt b/base/testfiles/tlb-mathcallbacks.lvt
new file mode 100644
index 00000000..7c231d4b
--- /dev/null
+++ b/base/testfiles/tlb-mathcallbacks.lvt
@@ -0,0 +1,31 @@
+\input{test2e}
+\begin{document}
+\START
+\ifx\directlua\undefined\END\expandafter\stop\fi
+\directlua{
+  luatexbase.add_to_callback('pre_mlist_to_hlist_filter', function(mlist)
+    texio.write_nl'pre_mlist_to_hlist_filter called'
+    return mlist
+  end, 'test')
+}
+\[ 1 \]
+\directlua{
+  luatexbase.add_to_callback('mlist_to_hlist', function(...)
+    texio.write_nl'mlist_to_hlist called'
+    return node.mlist_to_hlist(...)
+  end, 'test')
+}%
+\[ 1 \]%
+\directlua{
+  luatexbase.remove_from_callback('mlist_to_hlist', 'test')
+}
+\[ 1 \]
+\directlua{
+  luatexbase.add_to_callback('mlist_to_hlist', function(...)
+    texio.write_nl'new mlist_to_hlist called'
+    return node.mlist_to_hlist(...)
+  end, 'test')
+}%
+\[ 1 \]
+\END
+\end{document}
diff --git a/base/testfiles/github-0060.luatex.tlg b/base/testfiles/tlb-mathcallbacks.tlg
similarity index 100%
copy from base/testfiles/github-0060.luatex.tlg
copy to base/testfiles/tlb-mathcallbacks.tlg





More information about the latex3-commits mailing list.