mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
Add option --only-data-dir (-x)
Only use the dictionaries in data-dir, do not search in user and system directories This makes testing much easier
This commit is contained in:
19
tests/t_only_data_dir
Executable file
19
tests/t_only_data_dir
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
SDCV="$1"
|
||||
TEST_DIR="$2"
|
||||
|
||||
unset SDCV_PAGER
|
||||
unset STARDICT_DATA_DIR
|
||||
|
||||
DICTS=$($SDCV -x -n -l --data-dir "$TEST_DIR" | tail -n +2 | wc -l)
|
||||
# the expected result:
|
||||
ACTUAL_DICTS=$(find "$TEST_DIR" -name "*.ifo" | wc -l)
|
||||
if [ $DICTS -ne $ACTUAL_DICTS ]; then
|
||||
echo "number of dictionaries in $TEST_DIR should be $ACTUAL_DICTS but was $DICTS according to sdcv"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user