mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
en: add replacement rule tests
This commit is contained in:
@@ -103,6 +103,7 @@ src/speak-ng
|
||||
tests/*.test
|
||||
!tests/language-phonemes.test
|
||||
!tests/language-pronunciation.test
|
||||
!tests/language-replace.test
|
||||
!tests/ssml.test
|
||||
!tests/translate.test
|
||||
|
||||
|
||||
@@ -249,6 +249,7 @@ check: tests/encoding.check \
|
||||
tests/ssml-fuzzer.check \
|
||||
tests/api.check \
|
||||
tests/language-phonemes.check \
|
||||
tests/language-replace.check \
|
||||
tests/language-pronunciation.check
|
||||
|
||||
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
##### English
|
||||
|
||||
cat > expected.txt <<EOF
|
||||
Translate 'aeon'
|
||||
Found: 'mediaeval'
|
||||
Translate 'oeconomy'
|
||||
Found: 'phoenix'
|
||||
EOF
|
||||
test_replace en "Æon mediæval. Œconomy phœnix."
|
||||
|
||||
Reference in New Issue
Block a user