File: ispell-typos

package info (click to toggle)
igerman98 20161207-15
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,264 kB
  • sloc: perl: 925; makefile: 478; sh: 472; sed: 46
file content (29 lines) | stat: -rwxr-xr-x 760 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
#
# Test with wrong UTF-8 German words.
#
# (c) 2020 Roland Rosenfeld <roland@debian.org>

TESTSDIR=$(dirname $0)

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

cat $TESTSDIR/typo.utf8.txt $TESTSDIR/austriazismen.utf8.txt \
    $TESTSDIR/helvetismen.utf8.txt > $AUTOPKGTEST_TMP/typo.utf8.txt

ispell -l -w 'äöüßÄÖÜäöüßâêéñà' -Tlatin1 -d ngerman \
       < $AUTOPKGTEST_TMP/typo.utf8.txt \
       > $AUTOPKGTEST_TMP/ispell.typo.out

if diff $AUTOPKGTEST_TMP/ispell.typo.out $AUTOPKGTEST_TMP/typo.utf8.txt \
	> $AUTOPKGTEST_TMP/diff.typo.out
then
    exit 0
else
    echo "following words are wrongly accepted:"
    grep -a '^>' $AUTOPKGTEST_TMP/diff.typo.out
    exit 1
fi