summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-25 16:07:35 +0000
committerKarl Berry <karl@freefriends.org>2021-07-25 16:07:35 +0000
commitfdd1cdfaad879053afd699ff95858bd349a8ceb5 (patch)
treeacc2cda217c6efb950dff3db7775c053836ff413 /Build/source/texk/web2c/tests
parent58f97acc491936eb759faf84558cb30df19cd953 (diff)
new cross-engine primitives \partokenname and \partokencontext, from Petr Olsak
git-svn-id: svn://tug.org/texlive/trunk@60054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests')
-rw-r--r--Build/source/texk/web2c/tests/cmr10.pfbbin0 -> 35752 bytes
-rw-r--r--Build/source/texk/web2c/tests/partoken-ok.tex48
-rw-r--r--Build/source/texk/web2c/tests/partoken-xfail.tex31
3 files changed, 79 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/tests/cmr10.pfb b/Build/source/texk/web2c/tests/cmr10.pfb
new file mode 100644
index 00000000000..fa8c833d374
--- /dev/null
+++ b/Build/source/texk/web2c/tests/cmr10.pfb
Binary files differ
diff --git a/Build/source/texk/web2c/tests/partoken-ok.tex b/Build/source/texk/web2c/tests/partoken-ok.tex
new file mode 100644
index 00000000000..329505db804
--- /dev/null
+++ b/Build/source/texk/web2c/tests/partoken-ok.tex
@@ -0,0 +1,48 @@
+% $Id$
+% Public domain. Originally written by Petr Olsak, 2021.
+% Testing \partokenname and \partokencontext primitives: successful tests.
+%
+% We want to test in iniTeX state, use "pdftex -ini partoken-test.tex"
+% Generating dvi output.
+%
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+\hsize=4in \vsize=4in \baselineskip=12pt
+\font\f=cmr10 \f % we want to typeset some text
+
+% Seting different partoken name
+\catcode`\_=11
+\partokenname \_par
+\let \_par = \par
+\def\par{hello}
+% This empty line emits \_par (i.e., no output), no "hello":
+
+% Not-\long macro accepts \par in its argument, but does not accept \_par
+% (emitted here from blank line):
+\def\macro#1{}
+\macro{long test: \par} % without error
+% see partoken-xfail.tex for failing test.
+%
+\let \_endgraf=\_par
+\def \_par{PAR-TOKEN\_endgraf}
+% This empty line prints PAR-TOKEN (plus underfull \hbox
+% due to \parfillskip=0pt):
+
+% This \vskip prints Test PAR-TOKEN (plus underfull \hbox warning):
+Test \vskip1pt \relax
+%
+% This end-of-\vbox prints 0: Test text. (standard behavior):
+\vbox{\the\partokencontext: Test text.}
+%
+\partokencontext=1
+% This prints 1: Test text.PAR-TOKEN (\_par called at end of \vbox):
+\vbox{\the\partokencontext: Test text.}
+%
+% This prints 1: no-align text (standard behavior):
+\halign{#\cr \noalign{\the\partokencontext: no-align text}}
+%
+\partokencontext=2
+% This prints: 2: no-align textPAR-TOKEN (\_par called at end of \noalign):
+\halign{#\cr \noalign{\the\partokencontext: no-align text}}
+%
+% no blank line to elide final PAR-TOKEN.
+\end
diff --git a/Build/source/texk/web2c/tests/partoken-xfail.tex b/Build/source/texk/web2c/tests/partoken-xfail.tex
new file mode 100644
index 00000000000..6d2208992e5
--- /dev/null
+++ b/Build/source/texk/web2c/tests/partoken-xfail.tex
@@ -0,0 +1,31 @@
+% $Id$
+% Public domain. Originally written by Petr Olsak, 2021.
+% Testing \partokenname and \partokencontext primitives: an expected failure.
+%
+% We want to test in iniTeX state, use "pdftex -ini partoken-test.tex"
+%
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+\hsize=4in \vsize=4in \baselineskip=12pt
+\font\f=cmr10 \f
+\nonstopmode
+
+% Seting different partoken name
+\catcode`\_=11
+\let \_par = \par
+\partokenname \_par
+\def\par{hello}
+
+% Not-\long macro does not accept \_par
+% (emitted here from blank line):
+\def\macro#1{}
+% see partoken-ok.tex for successful test.
+\macro{failing long test:
+
+} % generates error:
+% ! Paragraph ended before \macro was complete.
+% <to be read again>
+% \_par
+% l.20
+% plus dependent error: Too many }'s.
+
+\end