#!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Some tests for C# support
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-cs-1.cs"
cat <<EOF > xg-cs-1.cs
using GNU.Gettext;
class TestCase {
// commented out through #if
String test5 = rm.GetString("Test String 5");
#endif
+ // verbatim string
+ String test5 = rm.GetString(@"first line
+second line
+third line");
}
}
EOF
-tmpfiles="$tmpfiles xg-cs-1.tmp.po xg-cs-1.po"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --omit-header --no-location -c -d xg-cs-1.tmp xg-cs-1.cs
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
-LC_ALL=C tr -d '\r' < xg-cs-1.tmp.po > xg-cs-1.po
-test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --omit-header --no-location -c -d xg-cs-1.tmp xg-cs-1.cs || exit 1
+LC_ALL=C tr -d '\r' < xg-cs-1.tmp.po > xg-cs-1.po || exit 1
-tmpfiles="$tmpfiles xg-cs-1.ok"
cat <<EOF > xg-cs-1.ok
#. standard usage
msgid "Test String 1"
#. commented out through #if
msgid "Test String 5"
msgstr ""
+
+#. verbatim string
+msgid ""
+"first line\n"
+"second line\n"
+"third line"
+msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-cs-1.ok xg-cs-1.po
result=$?
-rm -fr $tmpfiles
-
exit $result