#!/bin/sh
#
# Test hunspell dictionary with a correct UTF-8 de_AT text.
#
# (c) 2018 Roland Rosenfeld <roland@debian.org>

TESTSDIR=$(dirname $0)

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

trap "rm -rf $ADTTMP" 0 INT QUIT ABRT PIPE TERM

cat $TESTSDIR/correct.utf8.txt $TESTSDIR/austriazismen.utf8.txt \
    > $ADTTMP/correct.at.txt
OUTPUT=$(hunspell -l -d de_AT < $ADTTMP/correct.at.txt)

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