gettext/gettext-tools/tests/xgettext-python-6
Bruno Haible d1d131a036 tests: Prefer 'cat <<\EOF' to 'cat <<EOF' whenever possible.
Rationale: Not interpreting $ and \ in the here documents is a better default
than interpreting them.

* gettext-tools/tests/*: Write 'cat <<\EOF' instead of 'cat <<EOF', when no
shell dollar-substitution and backslash-interpretation is needed.
2024-08-16 10:36:58 +02:00

24 lines
456 B
Bash
Executable File

#!/bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test Python support: a python-brace-format string with a NUL byte.
tr X '\0' <<\EOF > xg-py-6.py
_("{0:X>}")
EOF
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-py-6.tmp xg-py-6.py || Exit 1
LC_ALL=C tr -d '\r' < xg-py-6.tmp.po > xg-py-6.po || Exit 1
cat <<\EOF > xg-py-6.ok
msgid "{0:"
msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-py-6.ok xg-py-6.po
result=$?
exit $result