File: t_exact

package info (click to toggle)
sdcv 0.5.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 596 kB
  • sloc: cpp: 3,082; sh: 226; xml: 23; makefile: 10
file content (24 lines) | stat: -rwxr-xr-x 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

SDCV="$1"
TEST_DIR="$2"

unset SDCV_PAGER

test_word() {
    WORD=$1
    EXPECTED=$2
    TAG=$3
    RES=$($SDCV -e -n --data-dir "$TEST_DIR" -u "Test synonyms" $WORD | grep "$TAG")
    if [ "$EXPECTED" != "$RES" ]; then
	echo "synonym for $WORD should be '$EXPECTED' but was '$RES'"
	exit 1
    fi
}

test_word testawordies "Nothing similar to testawordies, sorry :(" "Nothing similar"
test_word testawordy "word that ends in y to test with fuzzy search in -ied" "fuzzy"

exit 0