summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-sh-3
blob: 6f304a1712e98262e77033dbc98cb87df11b225a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

# Test Shell support: backslashed double-quotes inside single-quotes.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles xg-sh-3.sh"
cat <<\EOF > xg-sh-3.sh
echo `gettext 'abc\"def'`
EOF

tmpfiles="$tmpfiles xg-sh-3.tmp.po xg-sh-3.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-sh-3.tmp xg-sh-3.sh
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tr -d '\r' < xg-sh-3.tmp.po > xg-sh-3.po
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles xg-sh-3.ok"
cat <<\EOF > xg-sh-3.ok
msgid "abc\\\"def"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-sh-3.ok xg-sh-3.po
result=$?

rm -fr $tmpfiles

exit $result