[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks-doc-updates: Add test files for the new commands (608ca7c3)

PhelypeOleinik phelype.oleinik at latex-project.org
Fri Aug 6 06:08:13 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : lthooks-doc-updates
Link       : https://github.com/latex3/latex2e/commit/608ca7c3606f373c192cb06cb9be354a9b6f8214

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

commit 608ca7c3606f373c192cb06cb9be354a9b6f8214
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Fri Aug 6 01:08:13 2021 -0300

    Add test files for the new commands


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

608ca7c3606f373c192cb06cb9be354a9b6f8214
 ...before.lvt => lthooks-029-deprecated-after.lvt} | 32 ++++++++++-----------
 ...ecated.tlg => lthooks-029-deprecated-after.tlg} | 33 ++++++++++------------
 .../lthooks-029-deprecated-before.lvt              |  3 ++
 3 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt b/base/testfiles-lthooks/lthooks-029-deprecated-after.lvt
similarity index 63%
copy from base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
copy to base/testfiles-lthooks/lthooks-029-deprecated-after.lvt
index ee31d878..a96cefe6 100644
--- a/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
+++ b/base/testfiles-lthooks/lthooks-029-deprecated-after.lvt
@@ -1,9 +1,9 @@
-% 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.
+% This test file shows the behaviour of the commands that replaced
+% \ProvideHook.  This test should produce the same output as the
+% old lthooks-029 test.
+
+% This test file should be removed when the deprecation cycle of
+% \ProvideHook ends and the command is removed.
 
 \RequirePackage[enable-debug]{expl3}
 \ExplSyntaxOn
@@ -27,23 +27,23 @@
 
 \typeout{------------ provide a known hook --------------}
 
-\ProvideHook{aaa}
+\ActivateGenericHook{aaa} % \ProvideHook
 \ShowHook{aaa}
 
 \typeout{------------ provide a known hook with data --------------}
 
 \AddToHook{aaa}[X]{X1}
 
-\ProvideHook{aaa}
+\ActivateGenericHook{aaa} % \ProvideHook
 \ShowHook{aaa}
 
 \AddToHook{bbb}[Y]{Y1}
 
 \typeout{------------ provide an unknown hook with data --------------}
 
-\ProvideHook{bbb}
+\ActivateGenericHook{bbb} % \ProvideHook
 \ShowHook{bbb}
-\ProvideHook{bbb}
+\ActivateGenericHook{bbb} % \ProvideHook
 \ShowHook{bbb}
 
 \typeout{------------ provide an unknown reversed hook --------------}
@@ -53,30 +53,30 @@
 
 \typeout{------------ provide an known reversed hook --------------}
 
-\ProvideReversedHook{ccc}
+\ActivateGenericHook{ccc} % \ProvideReversedHook
 \ShowHook{ccc}
 
 \AddToHook{ccc}[Z]{Z1}
 
 \typeout{------------ provide an known reversed hook with data --------------}
 
-\ProvideReversedHook{ccc}
+\ActivateGenericHook{ccc} % \ProvideReversedHook
 \ShowHook{ccc}
 
 \typeout{------------ provide an reversed hook on an existing normal hook --------------}
 
-\ProvideReversedHook{aaa}
+\ActivateGenericHook{aaa} % \ProvideReversedHook
 \ShowHook{aaa}
 
 \typeout{------------ provide an normal hook on an existing reversed hook --------------}
 
-\ProvideHook{ccc}
+\ActivateGenericHook{ccc} % \ProvideHook
 \ShowHook{ccc}
 
 \typeout{------------ provide hook that was disabled --------------}
 
-\DisableHook{ddd}
-\ProvideHook{ddd}
+\DisableGenericHook{ddd} % \DisableHook
+\ActivateGenericHook{ddd} % \ProvideHook
 \ShowHook{ddd}
 
 
diff --git a/base/testfiles-lthooks/lthooks-029-deprecated.tlg b/base/testfiles-lthooks/lthooks-029-deprecated-after.tlg
similarity index 80%
copy from base/testfiles-lthooks/lthooks-029-deprecated.tlg
copy to base/testfiles-lthooks/lthooks-029-deprecated-after.tlg
index 7c050942..7c282417 100644
--- a/base/testfiles-lthooks/lthooks-029-deprecated.tlg
+++ b/base/testfiles-lthooks/lthooks-029-deprecated-after.tlg
@@ -72,19 +72,25 @@ l. ...\ShowHook{bbb}
 <recently read> }
 l. ...\ShowHook{ccc}
 ------------ provide an known reversed hook --------------
-LaTeX hooks Warning: Command \ProvideReversedHook is deprecated and will be
-(hooks)              removed in 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}
+                               % \ProvideReversedHook
+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':
 > The hook is empty.
 <recently read> }
 l. ...\ShowHook{ccc}
 ------------ provide an known reversed hook with data --------------
-LaTeX hooks Warning: Command \ProvideReversedHook is deprecated and will be
-(hooks)              removed in 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}
+                               % \ProvideReversedHook
+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':
 > Code chunks:
 >     Z -> Z1
@@ -99,16 +105,6 @@ LaTeX hooks Warning: Command \ProvideReversedHook is deprecated and will be
 <recently read> }
 l. ...\ShowHook{ccc}
 ------------ provide an reversed hook on an existing normal hook --------------
-LaTeX hooks Warning: Command \ProvideReversedHook is deprecated and will be
-(hooks)              removed in a future release.
-(hooks)              
-(hooks)              Use \ActivateGenericHook instead.
-! LaTeX hooks Error: Hook 'aaa' already declared as a normal hook!
-For immediate help type H <return>.
- ...                                              
-l. ...\ProvideReversedHook{aaa}
-You attempted to activate the hook 'aaa' as a reversed hook, but it was
-already previously declared as a normal hook. A redeclaration is not possible.
 -> The hook 'aaa':
 > Code chunks:
 >     X -> X1
@@ -127,6 +123,7 @@ l. ...\ShowHook{aaa}
 For immediate help type H <return>.
  ...                                              
 l. ...\ActivateGenericHook{ccc}
+                               % \ProvideHook
 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':
diff --git a/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt b/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
index ee31d878..08bbbe82 100644
--- a/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
+++ b/base/testfiles-lthooks/lthooks-029-deprecated-before.lvt
@@ -5,6 +5,9 @@
 % commands (as suggested by the deprecation warnings) so it should
 % produce the same output, but without the warnings.
 
+% This test file should be removed when the deprecation cycle of
+% \ProvideHook ends and the command is removed. 
+
 \RequirePackage[enable-debug]{expl3}
 \ExplSyntaxOn
 \debug_on:n { check-declarations , deprecation }





More information about the latex3-commits mailing list.