summaryrefslogtreecommitdiff
path: root/indexing/makeindexk/tests/makeindex.test
blob: b8bbe8943c549ee328f88613e59e93fb932b859f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /bin/sh -vx
# $Id: makeindex.test 68083 2023-08-27 14:18:16Z takuji $
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2012 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_makeindex=$BinDir/makeindex$ExeExt

TEXMFCNF=$srcdir/../kpathsea
export TEXMFCNF

rm -f sample.* range*.* pprec*.* romalp*.*
rc=0

$_makeindex $srcdir/tests/sample.idx -o sample.ind1 -t sample.ilg1 \
	&& diff $srcdir/tests/sample.ind sample.ind1 || rc=1

cat $srcdir/tests/sample.idx | $_makeindex >sample.ind2 2>sample.ilg2 \
	&& diff $srcdir/tests/sample.ind sample.ind2 || rc=2


# test for range suffix_2p, suffix_3p, suffix_mp

for num in 1 2 3; do
$_makeindex -s $srcdir/tests/range$num.ist $srcdir/tests/range.idx \
	-o range$num.ind1 -t range$num.ilg \
	&& diff $srcdir/tests/range$num.ind range$num.ind1 || rc=3
done


# test for page_precedence and suffix_3p

sfx=A
for num in 0 1 2; do
$_makeindex -s $srcdir/tests/pprec$num.ist $srcdir/tests/pprec$sfx.idx \
	-o pprec$sfx-$num.ind1 -t pprec$sfx-$num.ilg \
	&& diff $srcdir/tests/pprec$sfx-$num.ind pprec$sfx-$num.ind1 || rc=4
done
sfx=B
for num in 0 3 4; do
$_makeindex -s $srcdir/tests/pprec$num.ist $srcdir/tests/pprec$sfx.idx \
	-o pprec$sfx-$num.ind1 -t pprec$sfx-$num.ilg \
	&& diff $srcdir/tests/pprec$sfx-$num.ind pprec$sfx-$num.ind1 || rc=5
done


# test for page_precedence, heuristic detection if a letter is Roman or Alpha

sfx=A
for num in 5 6; do
$_makeindex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
	-o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
	&& diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=6
done
sfx=B
for num in 5 6 7; do
$_makeindex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
	-o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
	&& diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=7
done
sfx=C
for num in 5; do
$_makeindex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
	-o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
	&& diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=8
done
sfx=D
for num in 5 6 7; do
$_makeindex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
	-o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
	&& diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=9
done


exit $rc