[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks-doc-updates: Add test files for the deprecated commands (b20f90f5)
PhelypeOleinik
phelype.oleinik at latex-project.org
Fri Aug 6 06:04:08 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : lthooks-doc-updates
Link : https://github.com/latex3/latex2e/commit/b20f90f59dec1e6152e4605655e1d9d2ba837244
>---------------------------------------------------------------
commit b20f90f59dec1e6152e4605655e1d9d2ba837244
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Fri Aug 6 01:04:08 2021 -0300
Add test files for the deprecated commands
>---------------------------------------------------------------
b20f90f59dec1e6152e4605655e1d9d2ba837244
...cated.lvt => lthooks-029-deprecated-before.lvt} | 21 ++++++++++-----
...cated.tlg => lthooks-029-deprecated-before.tlg} | 30 +++++++++++++++++++++-
2 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/base/testfiles-lthooks/lthooks-029-deprecated.lvt b/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
similarity index 71%
copy from base/testfiles-lthooks/lthooks-029-deprecated.lvt
copy to base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
index 371a77c2..ee31d878 100644
--- a/base/testfiles-lthooks/lthooks-029-deprecated.lvt
+++ b/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
@@ -1,3 +1,10 @@
+% This test file shows the old behaviour of \ProvideHook (which then
+% became \ActivateGenericHook). This test should produce the same
+% output (modulo deprecation warnings) as the old lthooks-029 test.
+% The test file lthooks-029-deprecated-after test will use the new
+% commands (as suggested by the deprecation warnings) so it should
+% produce the same output, but without the warnings.
+
\RequirePackage[enable-debug]{expl3}
\ExplSyntaxOn
\debug_on:n { check-declarations , deprecation }
@@ -20,23 +27,23 @@
\typeout{------------ provide a known hook --------------}
-\ActivateGenericHook{aaa}
+\ProvideHook{aaa}
\ShowHook{aaa}
\typeout{------------ provide a known hook with data --------------}
\AddToHook{aaa}[X]{X1}
-\ActivateGenericHook{aaa}
+\ProvideHook{aaa}
\ShowHook{aaa}
\AddToHook{bbb}[Y]{Y1}
\typeout{------------ provide an unknown hook with data --------------}
-\ActivateGenericHook{bbb}
+\ProvideHook{bbb}
\ShowHook{bbb}
-\ActivateGenericHook{bbb}
+\ProvideHook{bbb}
\ShowHook{bbb}
\typeout{------------ provide an unknown reversed hook --------------}
@@ -63,13 +70,13 @@
\typeout{------------ provide an normal hook on an existing reversed hook --------------}
-\ActivateGenericHook{ccc}
+\ProvideHook{ccc}
\ShowHook{ccc}
\typeout{------------ provide hook that was disabled --------------}
-\DisableGenericHook{ddd}
-\ActivateGenericHook{ddd}
+\DisableHook{ddd}
+\ProvideHook{ddd}
\ShowHook{ddd}
diff --git a/base/testfiles-lthooks/lthooks-029-deprecated.tlg b/base/testfiles-lthooks/lthooks-029-deprecated-before.tlg
similarity index 75%
copy from base/testfiles-lthooks/lthooks-029-deprecated.tlg
copy to base/testfiles-lthooks/lthooks-029-deprecated-before.tlg
index 7c050942..3a8e3ce8 100644
--- a/base/testfiles-lthooks/lthooks-029-deprecated.tlg
+++ b/base/testfiles-lthooks/lthooks-029-deprecated-before.tlg
@@ -21,11 +21,19 @@ l. ...\ShowHook{ccc}
<recently read> }
l. ...\ShowHook{aaa}
------------ provide a known hook --------------
+LaTeX hooks Warning: Command \ProvideHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \ActivateGenericHook instead.
-> The hook 'aaa':
> The hook is empty.
<recently read> }
l. ...\ShowHook{aaa}
------------ provide a known hook with data --------------
+LaTeX hooks Warning: Command \ProvideHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \ActivateGenericHook instead.
-> The hook 'aaa':
> Code chunks:
> X -> X1
@@ -40,6 +48,10 @@ l. ...\ShowHook{aaa}
<recently read> }
l. ...\ShowHook{aaa}
------------ provide an unknown hook with data --------------
+LaTeX hooks Warning: Command \ProvideHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \ActivateGenericHook instead.
-> The hook 'bbb':
> Code chunks:
> Y -> Y1
@@ -53,6 +65,10 @@ l. ...\ShowHook{aaa}
> Y.
<recently read> }
l. ...\ShowHook{bbb}
+LaTeX hooks Warning: Command \ProvideHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \ActivateGenericHook instead.
-> The hook 'bbb':
> Code chunks:
> Y -> Y1
@@ -123,10 +139,14 @@ already previously declared as a normal hook. A redeclaration is not possible.
<recently read> }
l. ...\ShowHook{aaa}
------------ provide an normal hook on an existing reversed hook --------------
+LaTeX hooks Warning: Command \ProvideHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \ActivateGenericHook instead.
! LaTeX hooks Error: Hook 'ccc' already declared as a reversed hook!
For immediate help type H <return>.
...
-l. ...\ActivateGenericHook{ccc}
+l. ...\ProvideHook{ccc}
You attempted to activate the hook 'ccc' as a normal hook, but it was already
previously declared as a reversed hook. A redeclaration is not possible.
-> The hook 'ccc':
@@ -143,6 +163,14 @@ previously declared as a reversed hook. A redeclaration is not possible.
<recently read> }
l. ...\ShowHook{ccc}
------------ provide hook that was disabled --------------
+LaTeX hooks Warning: Command \DisableHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \DisableGenericHook instead.
+LaTeX hooks Warning: Command \ProvideHook is deprecated and will be removed in
+(hooks) a future release.
+(hooks)
+(hooks) Use \ActivateGenericHook instead.
LaTeX hooks Warning: Cannot activate hook 'ddd' because it is disabled!
-> The hook 'ddd':
> The hook is not declared.
More information about the latex3-commits
mailing list.