Skip to content

Commit

Permalink
(u)ptex-{euc,sjis}: test for Japanese filename (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-tk committed Dec 17, 2022
1 parent af0f549 commit 2fc1dd7
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/texk/web2c/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4499,7 +4499,7 @@ ptex_ch_srcs = \

# pTeX Tests
#
ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test
ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test ptexdir/pfname.test
eptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/libmd5 \
$(ZLIB_INCLUDES) $(am__append_144)

Expand Down Expand Up @@ -4602,7 +4602,7 @@ uptftopl_LDADD = $(uptex_ldadd)
uptftopl_DEPENDENCIES = $(uptex_dependencies)

# upTeX Tests
uptex_tests = uptexdir/uptriptest.test uptexdir/upver.test uptexdir/upkcat.test
uptex_tests = uptexdir/uptriptest.test uptexdir/upver.test uptexdir/upkcat.test uptexdir/pfname.test
# uppPLtoTF/upTFtoPL
upweb_tests = uptexdir/upbibtex.test uptexdir/updvitype.test \
uptexdir/uppltotf.test uptexdir/uptftopl.test \
Expand Down
2 changes: 1 addition & 1 deletion source/texk/web2c/ptexdir/am/ptex.am
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ EXTRA_DIST += \

# pTeX Tests
#
ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test
ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test ptexdir/pfname.test
ptexdir/ptriptest.log: ptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
ptexdir/pver.log: ptex$(EXEEXT)
#pweb_tests = \
Expand Down
22 changes: 22 additions & 0 deletions source/texk/web2c/ptexdir/pfname.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/sh -vx
#
# Copyright 2022 Japanese TeX Development Community <[email protected]>
# You may freely use, modify and/or distribute this file.

test -d ptests || mkdir -p ptests
rm -f fn*.*

rc=0

TEXMFCNF=$srcdir/../kpathsea
TEXINPUTS=$srcdir/ptexdir/tests:.
export TEXMFCNF TEXINPUTS

for enc in euc sjis; do
for doc in fn fnさざ波; do
./ptex -ini -interaction nonstopmode -kanji=utf8 --kanji-internal=$enc $doc.tex >ptests/$doc-$enc-term.log || $rc=1
diff $doc.txt $srcdir/ptexdir/tests/fn.txt || $rc=2
done
done

exit $rc
14 changes: 14 additions & 0 deletions source/texk/web2c/ptexdir/tests/fn.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
% fn.tex
% UTF-8 encoding
\catcode`\{=1
\catcode`\}=2

\immediate\write16{JOB[\jobname] :: We are in fn.tex}

\immediate\openout0=\jobname.txt
\immediate\write0{abc αβγ абв あア※¥ 天地人}
\immediate\closeout0

\input fnさざ波.tex

\relax\end
1 change: 1 addition & 0 deletions source/texk/web2c/ptexdir/tests/fn.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abc αβγ абв あア※¥ 天地人
13 changes: 13 additions & 0 deletions source/texk/web2c/ptexdir/tests/fnさざ波.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
% fnさざ波.tex
% UTF-8 encoding
\catcode`\{=1
\catcode`\}=2

\immediate\write16{JOB[\jobname] :: We are in fnさざ波.tex}

\immediate\openout0=\jobname.txt
\immediate\write0{abc αβγ абв あア※¥ 天地人}
\immediate\closeout0

\relax\end

2 changes: 1 addition & 1 deletion source/texk/web2c/uptexdir/am/uptex.am
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ EXTRA_DIST += \
uptexdir/ChangeLog

# upTeX Tests
uptex_tests = uptexdir/uptriptest.test uptexdir/upver.test uptexdir/upkcat.test
uptex_tests = uptexdir/uptriptest.test uptexdir/upver.test uptexdir/upkcat.test uptexdir/pfname.test
uptexdir/uptriptest.log: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
uptexdir/upver.log uptexdir/upkcat.log: uptex$(EXEEXT)
upweb_tests = \
Expand Down
22 changes: 22 additions & 0 deletions source/texk/web2c/uptexdir/pfname.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/sh -vx
#
# Copyright 2022 Japanese TeX Development Community <[email protected]>
# You may freely use, modify and/or distribute this file.

test -d uptests || mkdir -p uptests
rm -f fn*.*

rc=0

TEXMFCNF=$srcdir/../kpathsea
TEXINPUTS=$srcdir/ptexdir/tests:.
export TEXMFCNF TEXINPUTS

for enc in euc sjis uptex; do
for doc in fn fnさざ波; do
./uptex -ini -interaction nonstopmode -kanji=utf8 --kanji-internal=$enc $doc.tex >uptests/$doc-$enc-term.log || $rc=1
diff $doc.txt $srcdir/ptexdir/tests/fn.txt || $rc=2
done
done

exit $rc

0 comments on commit 2fc1dd7

Please sign in to comment.