#!/bin/sh

# Test C# support: --add-comments option.

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

tmpfiles="$tmpfiles xg-cs-6.cs"
cat <<\EOF > xg-cs-6.cs
/* a */
/* b */ string s = /* c */
/* d */
/* e */ _( /* f */ "hello " /* g */ + /* h */ "world" /* i */ );
EOF

tmpfiles="$tmpfiles xg-cs-6.tmp.po xg-cs-6.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
  -d xg-cs-6.tmp xg-cs-6.cs
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
LC_ALL=C tr -d '\r' < xg-cs-6.tmp.po > xg-cs-6.po
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles xg-cs-6.ok"
cat <<EOF > xg-cs-6.ok
#. a
#. b
#. c
#. d
#. e
#. f
msgid "hello world"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-cs-6.ok xg-cs-6.po
result=$?

rm -fr $tmpfiles

exit $result