[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Tests for 584910d (22beec97)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Dec 17 18:36:36 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh441
Link       : https://github.com/latex3/latex2e/commit/22beec97553524cbfc80d23e8e6dbeae97e11ebc

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

commit 22beec97553524cbfc80d23e8e6dbeae97e11ebc
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Dec 17 14:36:36 2020 -0300

    Tests for 584910d


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

22beec97553524cbfc80d23e8e6dbeae97e11ebc
 base/testfiles-lthooks/lthooks-024.lvt | 18 +++++++++++++-
 base/testfiles-lthooks/lthooks-024.tlg | 45 ++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/base/testfiles-lthooks/lthooks-024.lvt b/base/testfiles-lthooks/lthooks-024.lvt
index 9fc73f16..72d19d27 100644
--- a/base/testfiles-lthooks/lthooks-024.lvt
+++ b/base/testfiles-lthooks/lthooks-024.lvt
@@ -89,10 +89,26 @@
 % errors
 \SetDefaultHookLabel{my-document}
 
+\AddToHook{begindocument}[top-level]{\TIMO\typeout{allowed}\OMIT}
 \PushDefaultHookLabel{my-document}
+  % top-level not allowed with other labels
+  \AddToHook{begindocument}[top-level]{not allowed}
+  %
   \testme{my-document}
   \usepackage{\jobname-pkgA}
   \testme{my-document}
 \PopDefaultHookLabel
 
-\END
+% extra \PopDefaultHookLabel error
+\PopDefaultHookLabel
+
+% missing \PopDefaultHookLabel error
+\PushDefaultHookLabel{error}
+\PushDefaultHookLabel{should}
+\PushDefaultHookLabel{this}
+
+\OMIT
+\begin{document}
+\TIMO
+
+\end{document}
diff --git a/base/testfiles-lthooks/lthooks-024.tlg b/base/testfiles-lthooks/lthooks-024.tlg
index dc8578ce..07f06a0c 100644
--- a/base/testfiles-lthooks/lthooks-024.tlg
+++ b/base/testfiles-lthooks/lthooks-024.tlg
@@ -175,6 +175,14 @@ l. ...\SetDefaultHookLabel{my-document}
 LaTeX does not know anything more about this error, sorry.
 Try typing <return> to proceed.
 If that doesn't work, type X <return> to quit.
+! Package hooks Error: Illegal \AddToHook{begindocument}[top-level]{...}.
+(hooks)                'top-level' is reserved for the user's document.
+For immediate help type H <return>.
+ ...                                              
+l. ......ook{begindocument}[top-level]{not allowed}
+The 'top-level' label is meant for user code only, and should only be used
+(sparingly) in the main document. Use the default label 'my-document' for this
+package, or another suitable label.
 -> The hook 'foo':
 > Code chunks:
 >     my-document/foo -> my-document/foo
@@ -258,3 +266,40 @@ If that doesn't work, type X <return> to quit.
 >     ---
 > Execution order:
 >     my-document/foo.
+! Package hooks Error: Extra \PopDefaultHookLabel.
+(hooks)                This command will be ignored.
+Type <return> to continue.
+ ...                                              
+l. ...\PopDefaultHookLabel
+LaTeX does not know anything more about this error, sorry.
+Try typing <return> to proceed.
+If that doesn't work, type X <return> to quit.
+allowed
+(lthooks-024.aux)
+! Package hooks Error: Missing \PopDefaultHookLabel.
+(hooks)                The label `this' was pushed but never popped.
+(hooks)                Something is wrong.
+Type <return> to continue.
+ ...                                              
+l. ...\end{document}
+LaTeX does not know anything more about this error, sorry.
+Try typing <return> to proceed.
+If that doesn't work, type X <return> to quit.
+! Package hooks Error: Missing \PopDefaultHookLabel.
+(hooks)                The label `should' was pushed but never popped.
+(hooks)                Something is wrong.
+Type <return> to continue.
+ ...                                              
+l. ...\end{document}
+LaTeX does not know anything more about this error, sorry.
+Try typing <return> to proceed.
+If that doesn't work, type X <return> to quit.
+! Package hooks Error: Missing \PopDefaultHookLabel.
+(hooks)                The label `error' was pushed but never popped.
+(hooks)                Something is wrong.
+Type <return> to continue.
+ ...                                              
+l. ...\end{document}
+LaTeX does not know anything more about this error, sorry.
+Try typing <return> to proceed.
+If that doesn't work, type X <return> to quit.





More information about the latex3-commits mailing list.