summaryrefslogtreecommitdiff
path: root/indexing/upmendex/source/tests/upmendex.test
blob: 84dfbd17beb5de499b184581dac0a5163c899cc6 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#! /bin/sh -vx
# $Id: upmendex.test 60549 2021-09-19 08:57:18Z takuji $
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2013 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

TEXMFCNF=$srcdir/../kpathsea
export TEXMFCNF

rm -f foo.* uni.* range*.* pprec*.* locale*.* attr*.* rule*.*

./upmendex $srcdir/tests/foo.idx -o foo.ind1 -t foo.ilg1 \
	&& diff $srcdir/tests/foo.ind foo.ind1 || exit 1

cat $srcdir/tests/foo.idx | ./upmendex >foo.ind2 2>foo.ilg2 \
	&& diff $srcdir/tests/foo.ind foo.ind2 || exit 1

./upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni.ist \
	$srcdir/tests/uni.idx -o uni.ind1 -t uni.ilg1 \
	&& diff $srcdir/tests/uni.ind uni.ind1 || exit 1

cat $srcdir/tests/uni.idx | \
	./upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni.ist \
	>uni.ind2 2>uni.ilg2 \
	&& diff $srcdir/tests/uni.ind uni.ind2 || exit 1

./upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni1.ist -s $srcdir/tests/uni2.ist \
	$srcdir/tests/uni.idx -o uni.ind3 -t uni.ilg3 \
	&& diff $srcdir/tests/uni.ind uni.ind3 || exit 1

# test for range suffix_2p, suffix_3p, suffix_mp
./upmendex -s $srcdir/tests/range1.ist $srcdir/tests/range.idx \
	-o range1.ind1 -t range1.ilg \
	&& diff $srcdir/tests/range1.ind range1.ind1 || exit 1

./upmendex -s $srcdir/tests/range2.ist $srcdir/tests/range.idx \
	-o range2.ind1 -t range2.ilg \
	&& diff $srcdir/tests/range2.ind range2.ind1 || exit 1

./upmendex -s $srcdir/tests/range3.ist $srcdir/tests/range.idx \
	-o range3.ind1 -t range3.ilg \
	&& diff $srcdir/tests/range3.ind range3.ind1 || exit 1

# test for page_precedence and suffix_3p
./upmendex -s $srcdir/tests/pprec0.ist $srcdir/tests/pprecA.idx \
	-o pprecA-0.ind1 -t pprecA-0.ilg \
	&& diff $srcdir/tests/pprecA-0.ind pprecA-0.ind1 || exit 1

./upmendex -s $srcdir/tests/pprec1.ist $srcdir/tests/pprecA.idx \
	-o pprecA-1.ind1 -t pprecA-1.ilg \
	&& diff $srcdir/tests/pprecA-1.ind pprecA-1.ind1 || exit 1

./upmendex -s $srcdir/tests/pprec2.ist $srcdir/tests/pprecA.idx \
	-o pprecA-2.ind1 -t pprecA-2.ilg \
	&& diff $srcdir/tests/pprecA-2.ind pprecA-2.ind1 || exit 1

./upmendex -s $srcdir/tests/pprec0.ist $srcdir/tests/pprecB.idx \
	-o pprecB-0.ind1 -t pprecB-0.ilg \
	&& diff $srcdir/tests/pprecB-0.ind pprecB-0.ind1 || exit 1

./upmendex -s $srcdir/tests/pprec3.ist $srcdir/tests/pprecB.idx \
	-o pprecB-3.ind1 -t pprecB-3.ilg \
	&& diff $srcdir/tests/pprecB-3.ind pprecB-3.ind1 || exit 1

./upmendex -s $srcdir/tests/pprec4.ist $srcdir/tests/pprecB.idx \
	-o pprecB-4.ind1 -t pprecB-4.ilg \
	&& diff $srcdir/tests/pprecB-4.ind pprecB-4.ind1 || exit 1

# test for icu_locale
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/locale1.ist $srcdir/tests/rule.idx \
	-o locale1.ind1 -t locale1.ilg \
	&& diff $srcdir/tests/locale1.ind locale1.ind1 || exit 1

# test for icu_attributes
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/attr1.ist $srcdir/tests/rule.idx \
	-o attr1.ind1 -t attr1.ilg \
	&& diff $srcdir/tests/attr1.ind attr1.ind1 || exit 1

# test for icu_rules
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule1.ist $srcdir/tests/rule.idx \
	-o rule1.ind1 -t rule1.ilg \
	&& diff $srcdir/tests/rule.ind rule1.ind1 || exit 1

./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule2.ist $srcdir/tests/rule.idx \
	-o rule2.ind1 -t rule2.ilg \
	&& diff $srcdir/tests/rule.ind rule2.ind1 || exit 1

# malformed input
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule3.ist $srcdir/tests/rule.idx \
	   -o rule3.ind1 -t rule3.ilg
if [ $? -eq 254 ]; then
  echo "Error check: OK"
else
  echo "Error check: NG"
  exit 1
fi

./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule4.ist $srcdir/tests/rule.idx \
	-o rule4.ind1 -t rule4.ilg
if [ $? -eq 254 ]; then
  echo "Error check: OK"
else
  echo "Error check: NG"
  exit 1
fi

# test for icu_locale + icu_rules
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/locale2.ist -s $srcdir/tests/rule1.ist $srcdir/tests/rule.idx \
	-o locale2-rule1.ind1 -t locale2-rule1.ilg \
	&& diff $srcdir/tests/locale2-rule.ind locale2-rule1.ind1 || exit 1