#!/bin/sh
#
# Test with a correct ISO-8859-1 (Latin1) German text.
#
# (c) 2018 Roland Rosenfeld <roland@debian.org>

TESTSDIR=$(dirname $0)

if [ -z "$AUTOPKGTEST_TMP" ]; then
    AUTOPKGTEST_TMP=$(mktemp -d)
fi

trap "rm -rf $AUTOPKGTEST_TMP" EXIT

iconv -f UTF-8 -t ISO-8859-1 < $TESTSDIR/correct.utf8.txt \
                             > $AUTOPKGTEST_TMP/correct.latin1.txt

OUTPUT=$(ispell -l -w '' -Tlatin1 -C -d ogerman \
		< $AUTOPKGTEST_TMP/correct.latin1.txt)

if [ -z "$OUTPUT" ]
then
    exit 0
else
    echo "ispell did not accept the following words:"
    echo $OUTPUT
    exit 1
fi
