[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Move testing errors to lthooks-errors (eec6c9a4)

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


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

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

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

    Move testing errors to lthooks-errors


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

eec6c9a427c69f1142530f15dd5e911f50c05e0b
 base/testfiles-lthooks/lthooks-024.lvt    | 21 +-----------
 base/testfiles-lthooks/lthooks-024.tlg    | 55 -------------------------------
 base/testfiles-lthooks/lthooks-errors.lvt | 25 ++++++++++++--
 base/testfiles-lthooks/lthooks-errors.tlg | 54 +++++++++++++++++++++++++++---
 4 files changed, 73 insertions(+), 82 deletions(-)

diff --git a/base/testfiles-lthooks/lthooks-024.lvt b/base/testfiles-lthooks/lthooks-024.lvt
index 72d19d27..f14809a6 100644
--- a/base/testfiles-lthooks/lthooks-024.lvt
+++ b/base/testfiles-lthooks/lthooks-024.lvt
@@ -86,29 +86,10 @@
 \cs_undefine:c { ver@\jobname-pkgC.sty }
 \ExplSyntaxOff
 
-% 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
 
-% extra \PopDefaultHookLabel error
-\PopDefaultHookLabel
-
-% missing \PopDefaultHookLabel error
-\PushDefaultHookLabel{error}
-\PushDefaultHookLabel{should}
-\PushDefaultHookLabel{this}
-
-\OMIT
-\begin{document}
-\TIMO
-
-\end{document}
+\END
diff --git a/base/testfiles-lthooks/lthooks-024.tlg b/base/testfiles-lthooks/lthooks-024.tlg
index 07f06a0c..4cb8a770 100644
--- a/base/testfiles-lthooks/lthooks-024.tlg
+++ b/base/testfiles-lthooks/lthooks-024.tlg
@@ -165,24 +165,6 @@ and I'll forget about whatever was undefined.
 >     ---
 > Execution order:
 >     top-level/foo.
-! Package hooks Error: You cannot change the default label for `top-level'.
-(hooks)                Illegal
-(hooks)                  \SetDefaultHookLabel{my-document}
-(hooks)                on line ....
-Type <return> to continue.
- ...                                              
-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
@@ -266,40 +248,3 @@ package, or another suitable label.
 >     ---
 > 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.
diff --git a/base/testfiles-lthooks/lthooks-errors.lvt b/base/testfiles-lthooks/lthooks-errors.lvt
index db381466..40fbc1c4 100644
--- a/base/testfiles-lthooks/lthooks-errors.lvt
+++ b/base/testfiles-lthooks/lthooks-errors.lvt
@@ -30,7 +30,26 @@
 \makeatletter
 \@expl@@@filehook at file@pop@@
 
-\ExplSyntaxOn
-\__hook_curr_name_pop:
+% 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}
+\PopDefaultHookLabel
+
+% extra \PopDefaultHookLabel error
+\PopDefaultHookLabel
+
+% missing \PopDefaultHookLabel error
+\PushDefaultHookLabel{error}
+\PushDefaultHookLabel{should}
+\PushDefaultHookLabel{this}
+
+\OMIT
+\begin{document}
+\TIMO
 
-\END
+\end{document}
diff --git a/base/testfiles-lthooks/lthooks-errors.tlg b/base/testfiles-lthooks/lthooks-errors.tlg
index c7e7ff8e..7275b9e1 100644
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@ -42,12 +42,58 @@ l. ...\@expl@@@filehook at file@pop@@
 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: ERROR! This should not happen. Tried to pop from an
-(hooks)                empty default label stack.
-(hooks)                Please report at https://github.com/latex3/latex2e.
+! Package hooks Error: You cannot change the default label for `top-level'.
+(hooks)                Illegal
+(hooks)                  \SetDefaultHookLabel{my-document}
+(hooks)                on line ....
+Type <return> to continue.
+ ...                                              
+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.
+! 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-errors.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. ...\__hook_curr_name_pop:
+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.