Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test file showing the wrong behaviour
- Loading branch information
1 parent
645514b
commit 64ae62e
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |