aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check-stateful
blob: 218103c239823a6bad46437f82887751b9817533 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Simple check of a stateful encoding.
# Usage: check-stateful SRCDIR CHARSET
srcdir="$1"
charset="$2"
set -e

# charset, modified for use in filenames.
charsetf=`echo "$charset" | sed -e 's,:,-,g'`

if test -f "${srcdir}"/"$charsetf"-snippet.alt; then
  ../src/iconv_no_i18n -f "$charset" -t UTF-8 < "${srcdir}"/"$charsetf"-snippet.alt > tmp-snippet
  cmp "${srcdir}"/"$charsetf"-snippet.UTF-8 tmp-snippet
fi
../src/iconv_no_i18n -f "$charset" -t UTF-8 < "${srcdir}"/"$charsetf"-snippet > tmp-snippet
cmp "${srcdir}"/"$charsetf"-snippet.UTF-8 tmp-snippet
../src/iconv_no_i18n -f UTF-8 -t "$charset" < "${srcdir}"/"$charsetf"-snippet.UTF-8 > tmp-snippet
cmp "${srcdir}"/"$charsetf"-snippet tmp-snippet
rm -f tmp-snippet
exit 0