gettext/gettext-tools/tests/xgettext-javascript-11
Bruno Haible 0baf23d1db xgettext: In language JavaScript, avoid a crash at an XML comment, CDATA, or PI.
* gettext-tools/src/x-javascript.c (phase5_scan_xml_markup): Return int instead
of bool.
(phase5_get): Ignore XML markup parsed by phase5_scan_xml_markup.
* gettext-tools/tests/xgettext-javascript-9: New file.
* gettext-tools/tests/xgettext-javascript-10: New file.
* gettext-tools/tests/xgettext-javascript-11: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
2023-03-14 02:57:28 +01:00

27 lines
563 B
Bash
Executable File

#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test JavaScript support: XML Processing Instruction.
cat <<\EOF > xg-js-11a.js
<??>
EOF
cat <<\EOF > xg-js-11b.js
<?xml version="1.0" encoding="UTF-8"?>
EOF
: ${XGETTEXT=xgettext}
LANGUAGE= LC_ALL=C ${XGETTEXT} --no-location -d xg-js-11.tmp xg-js-11a.js 2>xg-js-11.err
result=$?
cat xg-js-11.err
test $result = 0 || Exit 1
: ${XGETTEXT=xgettext}
LANGUAGE= LC_ALL=C ${XGETTEXT} --no-location -d xg-js-11.tmp xg-js-11b.js 2>xg-js-11.err
result=$?
cat xg-js-11.err
test $result = 0 || Exit 1
exit 0