From: Daiki Ueno
Date: Mon, 28 Sep 2015 10:12:27 +0000 (+0900)
Subject: tests: Add more test cases
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a859c5619fc5a116e0aecd036ff6569a9ab8e217;p=thirdparty%2Fgettext.git
tests: Add more test cases
---
diff --git a/gettext-tools/tests/xgettext-its-1 b/gettext-tools/tests/xgettext-its-1
index d1359ae98..605e93872 100755
--- a/gettext-tools/tests/xgettext-its-1
+++ b/gettext-tools/tests/xgettext-its-1
@@ -53,31 +53,65 @@ EOF
cat <<\EOF > its/rules/messages.its
+ xmlns:msg="http://www.gnu.org/s/gettext/ns/messages/1.0"
+ version="1.0">
+
+
+
+
+
+
+
+
+
+
-
+
+ This is code
+
+
+ This is a comment
+
+
+
+
+
+
+
+
+
+
+
+
EOF
cat <<\EOF >messages.xml
-
+
+
+]>
+
-
This is a test message
+
This is a test message &foo;><&""
-
This is a test message, with an element in a text
+
This is a non-translatable message
+
+
+
This is a test message, with an element in a text
$ echo ' ' >> /dev/null
+ $ cat < /dev/yes
-
-
+
This is a test message, with an attribute
@@ -86,46 +120,74 @@ cat <<\EOF >messages.xml
This is a test message, with a localization note
+
+
+ This is a test message, with a local localization note
+
+
+
+
+
+
+
+
This is a message with space preserved
+
EOF
cat <<\EOF >messages.ok
#. (itstool) path: message/p
-#: messages.xml:3
-msgid "This is a test message"
+#: messages.xml:8
+msgid "This is a test message &foo;><&\"\""
msgstr ""
#. (itstool) path: message/p
-#: messages.xml:6
-msgid "This is a test message, with an element in a text"
+#: messages.xml:14
+msgid "This is a test message, with an element in a text"
msgstr ""
-#. (itstool) path: p/code
-#: messages.xml:9
+#. This is code
+#. (itstool) path: message/code
+#: messages.xml:17
#, no-wrap
msgid ""
" $ echo ' ' >> /dev/null\n"
+" $ cat < /dev/yes\n"
msgstr ""
+#. This is a comment
#. (itstool) path: messages/message@comment
-#: messages.xml:14
-msgid "This is a comment"
+#: messages.xml:21
+msgid "This is a comment <>&""
msgstr ""
#. (itstool) path: message/p
-#: messages.xml:15
+#: messages.xml:22
msgid "This is a test message, with an attribute"
msgstr ""
#. This is a localization note
#. (itstool) path: message/p
-#: messages.xml:21
+#: messages.xml:28
msgid "This is a test message, with a localization note"
msgstr ""
-EOF
-${XGETTEXT} --its --omit-header -o messages.pot messages.xml 2>messages.err || { cat messages.err; exit 1; }
+#. This is a local localization note
+#. (itstool) path: message/p
+#: messages.xml:31
+msgid "This is a test message, with a local localization note"
+msgstr ""
+#. (itstool) path: message/p
+#: messages.xml:40
+#, no-wrap
+msgid " This is a message with space preserved"
+msgstr ""
+EOF
+
+${XGETTEXT} --its --no-wrap --omit-header -o messages.pot messages.xml 2>messages.err || { cat messages.err; exit 1; }
: ${DIFF=diff}
${DIFF} messages.ok messages.pot
result=$?
+
+exit $result