[latex3-commits] [latex3/latex2e] cmd-args: Update test files (56ee6ed8)

github at latex-project.org github at latex-project.org
Thu May 18 22:01:08 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : cmd-args
Link       : https://github.com/latex3/latex2e/commit/56ee6ed863584b6edc2e2822c126a6da90f29428

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

commit 56ee6ed863584b6edc2e2822c126a6da90f29428
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu May 18 17:01:08 2023 -0300

    Update test files


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

56ee6ed863584b6edc2e2822c126a6da90f29428
 base/testfiles-lthooks/ltcmdhooks-013.lvt | 20 +++++++-
 base/testfiles-lthooks/ltcmdhooks-013.tlg | 77 ++++++++++++++++++++++++++++++-
 base/testfiles-lthooks/ltcmdhooks-014.tlg |  2 +-
 base/testfiles-lthooks/ltcmdhooks-015.tlg |  2 +-
 4 files changed, 96 insertions(+), 5 deletions(-)

diff --git a/base/testfiles-lthooks/ltcmdhooks-013.lvt b/base/testfiles-lthooks/ltcmdhooks-013.lvt
index 2a53519d..d8f37258 100755
--- a/base/testfiles-lthooks/ltcmdhooks-013.lvt
+++ b/base/testfiles-lthooks/ltcmdhooks-013.lvt
@@ -1,7 +1,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\RequirePackage[enable-debug,check-declarations]{expl3}
+% \RequirePackage[enable-debug,check-declarations]{expl3}
 \ExplSyntaxOn
-\debug_on:n { deprecation }
+% \debug_on:n { deprecation }
 \ExplSyntaxOff
 
 \input{regression-test}
@@ -31,4 +31,20 @@
 \ShowHook{cmd/bar/before} % (1 argument)
 \ShowHook{cmd/bar/after} % (1 argument)
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\Abar#1{\typeout{[Abar/body] (#1)}}
+
+\AddToHookWithArguments{cmdAfoobefore}[X]{\typeout{[Afoo/before] (#1)}}
+\AddToHookWithArguments{cmd/Afoo/before}[X]{\typeout{[Afoo/before] (#1)}} % error
+\AddToHookWithArguments{cmd/Abar/before}[X]{\typeout{[Abar/before] (#1)}}
+\AddToHookWithArguments{cmd/Abar/after}[X]{\typeout{[Abar/after] (#2)}} % error
+
+\ShowHook{cmdAfoobefore}
+\ShowHook{cmd/Afoo/before} % (unknown arguments)
+
+\show\Abar
+\ShowHook{cmd/Abar/before} % (1 argument)
+\ShowHook{cmd/Abar/after} % (1 argument)
+
 \END
diff --git a/base/testfiles-lthooks/ltcmdhooks-013.tlg b/base/testfiles-lthooks/ltcmdhooks-013.tlg
index 9be4cc1a..d7b0eb20 100755
--- a/base/testfiles-lthooks/ltcmdhooks-013.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-013.tlg
@@ -82,7 +82,7 @@ are all screwed up? I'm going to assume that you meant ##.
 >     Not set because the hook is undeclared.
 <recently read> }
 l. ...\ShowHook{cmdfoobefore}
--> The generic hook 'cmd/foo/before' (9 arguments):
+-> The generic hook 'cmd/foo/before' (unknown arguments):
 > Code chunks:
 >     X -> \typeout {[foo/before] (#1)}
 > Document-level (top-level) code (executed last):
@@ -127,3 +127,78 @@ l. ...\ShowHook{cmd/bar/before}
 <recently read> }
 l. ...\ShowHook{cmd/bar/after}
                               % (1 argument)
+! LaTeX hooks Error: Generic hooks cannot be added to '\Afoo'.
+For immediate help type H <return>.
+ ...                                              
+l. ......o/before}[X]{\typeout{[Afoo/before] (#1)}}
+                                                   % error
+You tried to add a hook to '\Afoo', but LaTeX was unable to patch the command
+because it doesn't exist.
+! Illegal parameter number in definition of hook 'cmd/Abar/after'.
+(hooks)             Invalid code added on line ....
+<to be read again> 
+                   2
+l. ......bar/after}[X]{\typeout{[Abar/after] (#2)}}
+                                                   % error
+You meant to type ## instead of #, right?
+Or maybe a } was forgotten somewhere earlier, and things
+are all screwed up? I'm going to assume that you meant ##.
+-> The hook 'cmdAfoobefore':
+> The hook is not declared.
+> Code chunks:
+>     X -> \typeout {[Afoo/before] (#1)}
+> Document-level (top-level) code:
+>     ---
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order:
+>     Not set because the hook is undeclared.
+<recently read> }
+l. ...\ShowHook{cmdAfoobefore}
+-> The generic hook 'cmd/Afoo/before' (unknown arguments):
+> Code chunks:
+>     X -> \typeout {[Afoo/before] (#1)}
+> Document-level (top-level) code (executed last):
+>     ---
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order:
+>     X.
+<recently read> }
+l. ...\ShowHook{cmd/Afoo/before}
+                                % (unknown arguments)
+> \Abar=macro:
+#1->\UseHookWithArguments {cmd/Abar/before}{1}{#1}\typeout {[Abar/body] (#1)}\UseHookWithArguments {cmd/Abar/after}{1}{#1}.
+l. ...\show\Abar
+-> The generic hook 'cmd/Abar/before' (1 argument):
+> Code chunks:
+>     X -> \typeout {[Abar/before] (#1)}
+> Document-level (top-level) code (executed last):
+>     ---
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order:
+>     X.
+<recently read> }
+l. ...\ShowHook{cmd/Abar/before}
+                                % (1 argument)
+-> The generic hook 'cmd/Abar/after' (1 argument):
+> Code chunks:
+>     X -> \typeout {[Abar/after] (##2)}
+> Document-level (top-level) code (executed first):
+>     ---
+> Extra code for next invocation:
+>     ---
+> Rules:
+>     ---
+> Execution order (after reversal):
+>     X.
+<recently read> }
+l. ...\ShowHook{cmd/Abar/after}
+                               % (1 argument)
diff --git a/base/testfiles-lthooks/ltcmdhooks-014.tlg b/base/testfiles-lthooks/ltcmdhooks-014.tlg
index af52883e..a578a2ac 100755
--- a/base/testfiles-lthooks/ltcmdhooks-014.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-014.tlg
@@ -81,7 +81,7 @@ are all screwed up? I'm going to assume that you meant ##.
 >     Not set because the hook is undeclared.
 <recently read> }
 l. ...\ShowHook{cmdfoobefore}
--> The generic hook 'cmd/foo/before' (9 arguments):
+-> The generic hook 'cmd/foo/before' (unknown arguments):
 > Code chunks:
 >     ---
 > Document-level (top-level) code (executed last):
diff --git a/base/testfiles-lthooks/ltcmdhooks-015.tlg b/base/testfiles-lthooks/ltcmdhooks-015.tlg
index 7b057353..d303e2fa 100755
--- a/base/testfiles-lthooks/ltcmdhooks-015.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-015.tlg
@@ -81,7 +81,7 @@ are all screwed up? I'm going to assume that you meant ##.
 >     Not set because the hook is undeclared.
 <recently read> }
 l. ...\ShowHook{cmdfoobefore}
--> The generic hook 'cmd/foo/before' (9 arguments):
+-> The generic hook 'cmd/foo/before' (unknown arguments):
 > Code chunks:
 >     ---
 > Document-level (top-level) code (executed last):





More information about the latex3-commits mailing list.