[latex3-commits] [git/LaTeX3-latex3-latex2e] gh697: Add test file showing the wrong behaviour (64ae62e2)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Oct 21 03:49:38 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh697
Link       : https://github.com/latex3/latex2e/commit/64ae62e208a65a651b81021d8ad6a509f9eb7692

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

commit 64ae62e208a65a651b81021d8ad6a509f9eb7692
Author: Phelype Oleinik <phelype.oleinik at latex-project.org>
Date:   Wed Oct 20 16:39:21 2021 -0300

    Add test file showing the wrong behaviour


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

64ae62e208a65a651b81021d8ad6a509f9eb7692
 base/testfiles-lthooks/github-0697.lvt | 41 ++++++++++++++++++++++++++++++++++
 base/testfiles-lthooks/github-0697.tlg | 40 +++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+)

diff --git a/base/testfiles-lthooks/github-0697.lvt b/base/testfiles-lthooks/github-0697.lvt
new file mode 100644
index 00000000..4e88bcef
--- /dev/null
+++ b/base/testfiles-lthooks/github-0697.lvt
@@ -0,0 +1,41 @@
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation }
+\ExplSyntaxOff
+
+\input{test2e}
+
+% case 1: no parameter (hashes don't matter)
+\DeclareRobustCommand\fooA{\typeout{##}}
+
+% case 2: parameters and no hashes
+\DeclareRobustCommand\fooB[1]{\typeout{#1}}
+
+% case 2: parameters and with hashes
+\DeclareRobustCommand\fooC[1]{\typeout{#1/##2}}
+
+\AddToHook{cmd/fooA/before}{\typeout{fooA}}
+\AddToHook{cmd/fooB/before}{\typeout{fooB}}
+\AddToHook{cmd/fooC/before}{\typeout{fooC}}
+
+% check command with unbalanced conditionals in its replacement text:
+\DeclareRobustCommand\barA[1]{\typeout{#1/##2/\string\if\string\if\string\if}}
+\DeclareRobustCommand\barB[1]{\typeout{#1/##2/\string\fi\string\fi\string\fi}}
+
+\AddToHook{cmd/barA/before}{\typeout{barA}}
+\AddToHook{cmd/barB/before}{\typeout{barB}}
+
+\START
+
+\ExplSyntaxOn
+\__hook_cmd_begindocument_code:
+\ExplSyntaxOff
+
+\fooA
+\fooB{X}
+\fooC{X}
+\barA{X}
+\barB{X}
+
+\END
diff --git a/base/testfiles-lthooks/github-0697.tlg b/base/testfiles-lthooks/github-0697.tlg
new file mode 100644
index 00000000..acc3d61b
--- /dev/null
+++ b/base/testfiles-lthooks/github-0697.tlg
@@ -0,0 +1,40 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+! Illegal parameter number in definition of \fooA .
+<to be read again> 
+                   }
+l. ...\__hook_cmd_begindocument_code:
+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 ##.
+! Illegal parameter number in definition of \fooC .
+<to be read again> 
+                   2
+l. ...\__hook_cmd_begindocument_code:
+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 ##.
+! Illegal parameter number in definition of \barA .
+<to be read again> 
+                   2
+l. ...\__hook_cmd_begindocument_code:
+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 ##.
+! Illegal parameter number in definition of \barB .
+<to be read again> 
+                   2
+l. ...\__hook_cmd_begindocument_code:
+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 ##.
+fooA
+##
+fooB
+X
+fooC
+X/##2
+barA
+X/##2/\if\if\if
+barB
+X/##2/\fi\fi\fi





More information about the latex3-commits mailing list.