more robust parsing of ifo file

fixes #79 fixes #81
This commit is contained in:
Evgeniy A. Dushistov
2022-06-24 20:54:30 +03:00
parent 920c2bafb9
commit 12d9ea5b97
7 changed files with 95 additions and 83 deletions

View File

@@ -0,0 +1,9 @@
StarDict's dict ifo file
version=3.0.0
bookname=Russian-English Dictionary (ru-en)
wordcount=415144
idxfilesize=12344255
sametypesequence=h
synwordcount=1277580
author=Vuizur
description=

16
tests/t_newlines_in_ifo Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
set -e
PATH_TO_SDCV="$1"
TEST_DIR="$2"
unset SDCV_PAGER
RES=$("$PATH_TO_SDCV" -n -x --data-dir="$TEST_DIR/not-unix-newlines-ifo" -l | tail -n 1)
if [ "$RES" == "Russian-English Dictionary (ru-en) 415144" ]; then
exit 0
else
echo "test failed, unexpected result: $RES" >&2
exit 1
fi