summaryrefslogtreecommitdiff
path: root/biblio/bibtex/bibtex-x/tests/bibtexu-char.test
blob: e4250d02efdb90f140ec290fdc706e80d06a4bd1 (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
#! /bin/sh -vx
# $Id: bibtexu-char.test 68115 2023-08-30 11:16:53Z takuji $
# Copyright 2022-2023 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_bibtexu=$BinDir/bibtexu$ExeExt

test -d tests || mkdir tests
test -d tests || exit 1

LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE
#
TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
BSTINPUTS=$srcdir/tests; export BSTINPUTS
BIBINPUTS=$srcdir/tests; export BIBINPUTS


rc=0

if [ "$(expr substr $(uname -s) 1 5)" = "MINGW" ]; then
  echo "*** skip test $0 on MinGW"
  exit 77
fi

## test for add.period$
cp $srcdir/tests/periodu.aux tests/xperiodu.aux
$_bibtexu tests/xperiodu || rc=3
diff $srcdir/tests/periodu.bbl tests/xperiodu.bbl || rc=4

## test for substring$
cp $srcdir/tests/substru.aux tests/xsubstru.aux
$_bibtexu tests/xsubstru || rc=5
diff $srcdir/tests/substru.bbl tests/xsubstru.bbl || rc=6

## test for text.length$, text.prefix$
cp $srcdir/tests/txtprfxu.aux tests/xtxtprfxu.aux
$_bibtexu tests/xtxtprfxu || rc=7
diff $srcdir/tests/txtprfxu.bbl tests/xtxtprfxu.bbl || rc=8

## test for width$
##   (FIXME) Greek, Cyrillic are not impremented yet
cp $srcdir/tests/widthu.aux tests/xwidthu.aux
$_bibtexu tests/xwidthu || rc=9
diff $srcdir/tests/widthu.bbl tests/xwidthu.bbl || rc=10

## test for chr.to.int$, int.to.str$, int.to.chr$
cp $srcdir/tests/charu.aux tests/xcharu.aux
$_bibtexu tests/xcharu || rc=11
diff $srcdir/tests/charu.bbl tests/xcharu.bbl || rc=12

## test for num.names$, format.name$
cp $srcdir/tests/nameu.aux tests/xnameu.aux
max_print_line=119 $_bibtexu tests/xnameu || rc=13
diff $srcdir/tests/nameu.bbl tests/xnameu.bbl || rc=14

## test for is.knj.str$

DIFF="diff"; icuver=0
$_bibtexu --version | grep "ICU version 70" && icuver=70
if [ $icuver -eq 70 ]; then
  # skip CJK Ideograph Extension H
  # U+31350 -> \360\261\215\220
  uchr='\360\261\215\220'
  DIFF="diff --ignore-matching-lines="`printf "${uchr}"`
  echo "*** skip checking CJK Ideograph Extension H"
fi
cp $srcdir/tests/iscjku.aux tests/xiscjku.aux
$_bibtexu tests/xiscjku || rc=15
$DIFF $srcdir/tests/iscjku.bbl tests/xiscjku.bbl || rc=16

exit $rc