#!/bin/sh
#
# Test aspell dictionary with a correct UTF-8 de_CH-1901 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

sed 's/ß/ss/g' < $TESTSDIR/correct.utf8.txt > $ADTTMP/correct.ch.txt
OUTPUT=$(aspell list -d de_CH-1901 < $ADTTMP/correct.ch.txt)

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