Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-csharp-1
index 9f35c93..a7a77e9 100755 (executable)
@@ -1,11 +1,8 @@
 #!/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 {
@@ -25,18 +22,18 @@ 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"
@@ -57,12 +54,17 @@ msgstr ""
 #. 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