#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# The slash (/) and the question mark (?) serve a double-purpose in Perl.
# Depending on the context they can either be an operator (division
# or ternary respectively) or they are regex delimiters for pattern
# matches. This test case checks the proper recognition.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-pl-8.pl"
cat <<\EOF > xg-pl-8.pl
info(__("using %s."), ($a->b() eq "auto" ? "" : ""));
print __"Synching works.";
EOF
-tmpfiles="$tmpfiles xg-pl-8.tmp.po xg-pl-8.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -n \
-k__ \
- -d xg-pl-8.tmp xg-pl-8.pl
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-pl-8.tmp.po > xg-pl-8.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+ -d xg-pl-8.tmp xg-pl-8.pl || exit 1
+LC_ALL=C tr -d '\r' < xg-pl-8.tmp.po > xg-pl-8.po || exit 1
-tmpfiles="$tmpfiles xg-pl-8.ok"
cat <<\EOF > xg-pl-8.ok
#: xg-pl-8.pl:1
#, perl-format
${DIFF} xg-pl-8.ok xg-pl-8.po
result=$?
-rm -fr $tmpfiles
-
exit $result