Files
espeak-ng/tests/language-replace.test
T

66 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
test_replace() {
TEST_LANG=$1
TEST_TEXT=$2
echo "testing ${TEST_LANG}"
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
src/espeak-ng -Xq -v ${TEST_LANG} "${TEST_TEXT}" | grep -P "(Translate|Found:) " | sed -e 's/ \[.*][ ]*$//g' > actual.txt
diff expected.txt actual.txt || exit 1
}
##### en: English
cat > expected.txt <<EOF
Translate 'aeon'
Found: 'mediaeval'
Translate 'oeconomy'
Found: 'phoenix'
EOF
test_replace en "Æon mediæval. Œconomy phœnix."
##### sr: Serbian
# Ljubazni fenjerdžija čađavog lica hoće da mi pokaže štos.
cat > expected.txt <<EOF
Translate 'ljubazni'
Translate 'feѥrѩijaa'
Found: 'f'
Translate 'e'
Translate 'ѥ'
Found: '_?A'
Found: '_4'
Found: '_6'
Found: '_5'
Found: 'r'
Translate 'ѩ'
Found: '_?A'
Found: '_4'
Found: '_6'
Found: '_9'
Translate 'i'
Found: 'j'
Translate 'a'
Translate 'a'
Translate 'čaѡvčg'
Found: 'č'
Translate 'a'
Translate 'ѡ'
Found: '_?A'
Found: '_4'
Found: '_6'
Found: '_1'
Found: 'v'
Found: 'č'
Found: 'g'
Translate 'lica'
Translate 'hoće'
Translate 'da'
Translate 'mi'
Translate 'pokaže'
Translate 'štos'
EOF
test_replace sr "Љубазни фењерџија чађавог лица хоће да ми покаже штос."