[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Add tests (bf83ac56)
PhelypeOleinik
phelype.oleinik at latex-project.org
Sat Mar 11 03:06:36 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : hook-args
Link : https://github.com/latex3/latex2e/commit/bf83ac56dc73e8506cacd8b07640aadda61686e3
>---------------------------------------------------------------
commit bf83ac56dc73e8506cacd8b07640aadda61686e3
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Wed Dec 14 01:51:36 2022 -0300
Add tests
>---------------------------------------------------------------
bf83ac56dc73e8506cacd8b07640aadda61686e3
base/testfiles-lthooks/lthooks-033.lvt | 32 ++++++++++++++++++++++++++++++++
base/testfiles-lthooks/lthooks-033.tlg | 17 +++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/base/testfiles-lthooks/lthooks-033.lvt b/base/testfiles-lthooks/lthooks-033.lvt
new file mode 100644
index 00000000..b1511daf
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-033.lvt
@@ -0,0 +1,32 @@
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\input{regression-test}
+
+\documentclass{minimal}
+\begin{document}
+
+\START
+
+\NewHookWithArguments{test-2}{2}
+\AddToHook{test-2}{\typeout{top-level(#1,#2)}}
+\AddToHook{test-2}[label]{\typeout{label(#1,#2)}}
+\AddToHookNext{test-2}{\typeout{next(#1,#2)}}
+\UseHook{test-2}{foo}{bar}
+
+\NewHookWithArguments{test-0}{0}
+\AddToHook{test-0}{\typeout{top-level(#1,#2)}}
+\AddToHook{test-0}[label]{\typeout{label(#1,#2)}}
+\AddToHookNext{test-0}{\typeout{next(#1,#2)}}
+\UseHook{test-0}{foo}{bar}
+
+\NewHookWithArguments{test-10}{10}
+\AddToHook{test-10}{\typeout{top-level(#1,#2)}}
+\AddToHook{test-10}[label]{\typeout{label(#1,#2)}}
+\AddToHookNext{test-10}{\typeout{next(#1,#2)}}
+\UseHook{test-10}{foo}{bar}
+
+\END
diff --git a/base/testfiles-lthooks/lthooks-033.tlg b/base/testfiles-lthooks/lthooks-033.tlg
new file mode 100644
index 00000000..946076c7
--- /dev/null
+++ b/base/testfiles-lthooks/lthooks-033.tlg
@@ -0,0 +1,17 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+label(foo,bar)
+top-level(foo,bar)
+next(foo,bar)
+label(##1,##2)
+top-level(##1,##2)
+next(##1,##2)
+! LaTeX hooks Error: Too many arguments for hook 'test-10'.
+For immediate help type H <return>.
+ ...
+l. ...\NewHookWithArguments{test-10}{10}
+You tried to declare a hook with arguments, but a hook can only have up to
+nine. LaTeX will define this hook without arguments.
+label(##1,##2)
+top-level(##1,##2)
+next(##1,##2)
More information about the latex3-commits
mailing list.