Add a test for XML/SSML character and entity references

This commit is contained in:
Juho Hiltunen
2020-08-23 20:42:47 +03:00
parent 34657e7ea4
commit 959bf26b6b
3 changed files with 24 additions and 2 deletions
+11 -2
View File
@@ -2,12 +2,21 @@
test_ssml() {
INPUT=$1
if [ "$2" = "punct" ]
then
PARAMETERS="--punct -x"
else
PARAMETERS="-v en-US --ipa=2"
fi
echo "testing ${INPUT}"
cp $(dirname $INPUT)/$(basename ${INPUT%.*}).expected expected.txt
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
src/espeak-ng -m -q -v en-US --ipa=2 -f ${INPUT} > actual.txt
src/espeak-ng -m -q $PARAMETERS -f ${INPUT} > actual.txt
diff expected.txt actual.txt || exit 1
}
for i in `ls tests/ssml/*.ssml` ; do test_ssml $i ; done
for i in `ls tests/ssml/*.ssml` ; do test_ssml $i; done
for i in `ls tests/ssml/*.ssml2` ; do test_ssml $i punct; done
+4
View File
@@ -0,0 +1,4 @@
l'EsDan_: gr'eIt@D,an_: 'amp@s,and t'Ik_: kw'oUts
b'i: b'i:
z'Ed z'Ed
+9
View File
@@ -0,0 +1,9 @@
<!-- SSML reference test
Entity references &lt; &gt; &amp; &apos; and &quot; should be replaced in the buffer
Character references &#65; are translated to Unicode (65 = 'A')
See https://www.tutorialspoint.com/xml/xml_syntax.htm
-->
<speak> &lt; &gt; &amp; &apos; &quot; </speak>
<speak> B &#66;</speak>
<speak>z &#x7A;</speak>