]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Add missing file tests/xgettext-11
authorDaiki Ueno <ueno@gnu.org>
Sun, 4 May 2014 09:55:19 +0000 (18:55 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sun, 4 May 2014 09:55:19 +0000 (18:55 +0900)
gettext-tools/tests/xgettext-11 [new file with mode: 0644]

diff --git a/gettext-tools/tests/xgettext-11 b/gettext-tools/tests/xgettext-11
new file mode 100644 (file)
index 0000000..1b7a869
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test of multi-line comment extraction.
+
+cat <<\EOF > xg-test11.c
+/* TRANSLATORS: this
+ is the first msgid
+ */
+gettext ("abc");
+
+/*
+ * TRANSLATORS: this
+ * is the second msgid
+ */
+gettext ("def");
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --no-location --omit-header --add-comments=TRANSLATORS: -d xg-test11.tmp xg-test11.c || exit 1
+LC_ALL=C tr -d '\r' < xg-test11.tmp.po > xg-test11.po || exit 1
+
+cat <<\EOF > xg-test11.ok
+#. TRANSLATORS: this
+#. is the first msgid
+#.
+msgid "abc"
+msgstr ""
+
+#. TRANSLATORS: this
+#. is the second msgid
+#.
+msgid "def"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-test11.ok xg-test11.po
+result=$?
+
+exit $result