summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/ptexdir/tests
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-04-28 23:58:22 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-04-28 23:58:22 +0000
commitb4fc35ca221c0d7047dc66b722ffa3cf8482ad3e (patch)
tree162b8df1fff4915197978dbdd145f72f2073b0fb /Build/source/texk/web2c/ptexdir/tests
parent1a77a3b16971c8665435285caaae7f5625967994 (diff)
ptexdir: fix a regression for discontinuous kinsoku table introduced on 2017-09-11
git-svn-id: svn://tug.org/texlive/trunk@47477 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/ptexdir/tests')
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex53
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/free_pena.tex52
2 files changed, 105 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex b/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex
new file mode 100644
index 00000000000..9a3b2766415
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/free_ixsp.tex
@@ -0,0 +1,53 @@
+%#!eptex -ini -etex
+\let\dump\relax
+\batchmode
+\input plain
+
+\errorstopmode
+\catcode`@=11
+\newcount\@tempcnta
+\newcount\@tempcntb
+\newcount\@tempcntc
+\mathchardef\LIM=256
+
+\def\MYCHAR#1{%
+ \@tempcntc=\numexpr7*#1+"101\relax
+ \@tempcnta=\@tempcntc\divide\@tempcnta 94
+ \@tempcntb=\numexpr\@tempcntc-94*\@tempcnta+1\relax
+ \ifnum\@tempcntb<0\advance\@tempcntb94 \advance\@tempcnta-1\fi
+ \advance\@tempcnta18 % 18区以降
+ \CNTA=\kuten\numexpr"100*\@tempcnta+\@tempcntb\relax
+}
+
+\newcount\CNT\newcount\CNTA
+\CNT=0
+\loop
+ \MYCHAR\CNT
+ \message{\the\CNT.}
+ \inhibitxspcode\CNTA=1\relax
+ \advance\CNT1\relax
+ \ifnum\CNT<\LIM
+\repeat
+
+\newcount\CNTB
+
+\loop
+ \MYCHAR\CNTB
+ \global\inhibitxspcode\CNTA=3
+{%
+\CNT=0
+\loop
+ \MYCHAR\CNT
+ \count@=\numexpr 1-\inhibitxspcode\CNTA\relax
+ \ifnum\count@=0\else\ifnum\CNTB=\CNT\else
+ \errmessage{<\the\CNTB, \the\CNT, \the\inhibitxspcode\CNTA>}\fi\fi
+ \advance\CNT1\relax
+ \ifnum\CNT<\LIM
+\repeat
+}
+ \MYCHAR\CNTB
+ \global\inhibitxspcode\CNTA=1\relax
+ \advance\CNTB1\relax
+ \ifnum\CNTB<\LIM
+\repeat
+\bye
diff --git a/Build/source/texk/web2c/ptexdir/tests/free_pena.tex b/Build/source/texk/web2c/ptexdir/tests/free_pena.tex
new file mode 100644
index 00000000000..184720a80a2
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/free_pena.tex
@@ -0,0 +1,52 @@
+%#!eptex -ini -etex
+\let\dump\relax
+\batchmode
+\input plain
+
+\errorstopmode
+\catcode`@=11
+\newcount\@tempcnta
+\newcount\@tempcntb
+\newcount\@tempcntc
+\mathchardef\LIM=256
+
+\def\MYCHAR#1{%
+ \@tempcntc=\numexpr7*#1+"101\relax
+ \@tempcnta=\@tempcntc\divide\@tempcnta 94
+ \@tempcntb=\numexpr\@tempcntc-94*\@tempcnta+1\relax
+ \ifnum\@tempcntb<0\advance\@tempcntb94 \advance\@tempcnta-1\fi
+ \advance\@tempcnta18 % 18区以降
+ \CNTA=\kuten\numexpr"100*\@tempcnta+\@tempcntb\relax
+}
+
+\newcount\CNT\newcount\CNTA
+\CNT=0
+\loop
+ \MYCHAR\CNT
+ \message{\the\CNT.}
+ \prebreakpenalty\CNTA=\numexpr\CNT+1\relax
+ \advance\CNT1\relax
+ \ifnum\CNT<\LIM
+\repeat
+
+\newcount\CNTB
+
+\loop
+ \MYCHAR\CNTB
+ \global\prebreakpenalty\CNTA=0
+{%
+\CNT=0
+\loop
+ \MYCHAR\CNT
+ \count@=\numexpr -\CNT-1+\prebreakpenalty\CNTA\relax
+ \ifnum\count@=0\else\ifnum\CNTB=\CNT\else\errmessage{<\the\CNTB, \the\CNT>}\fi\fi
+ \advance\CNT1\relax
+ \ifnum\CNT<\LIM
+\repeat
+}
+ \MYCHAR\CNTB
+ \global\prebreakpenalty\CNTA=\numexpr\CNTB+1\relax
+ \advance\CNTB1\relax
+ \ifnum\CNTB<\LIM
+\repeat
+\bye